FileUtility
ReferencesThis class maintains all information and functionality regarding document files.
Constructors
Properties
BackupTimestamp
#Gets or sets the timestamp formatting to be used when backing up files which are about to be overwritten due to a Save operation.
BackupTimestampWithFallback
#Gets the user overridden time stamp format, or the default if the value has not been overridden.
BackupUserFolder
#Gets or sets the backup folder for when the BackupMethod equals BackupMethod.UserFolder.
DisplayText
#Gets the text used to describe this document. The DisplayText may contain the filename and the saved state, as well as hierarchical clues.
FallbackName
#Gets or sets the fallback name. If the file is otherwise unsaved, the fallback name (if set) will be used instead of "unnamed".
FileOverwriteWarning
#When a warning is set, saving a file requires an additional mouse click. The warning is not serialised. Typically backup and autosave files will have this warning set to avoid them being summarily overwritten.
Path
#Gets the filepath that this document is associated with. Not every document is associated with a file, so this field may be null or empty. Assigning a new path to a file does not trigger a save action.
Thumbnail
#public Bitmap Thumbnail { get; set; }
Gets or sets the thumbnail image for this document. The getter is lazy: if no thumbnail has been assigned yet it will attempt to generate one via TryCreateThumbnail() on first access.
Methods
AutoSave
#Perform an autosave operation.
Parameters:
| reason (AutoSaveReason) | Reason for autosave. |
| processId (Guid) | Id associated with request. Subsequent requests with identical IDs are ignored. |
CreatePreview
#Create a preview image of the entire document at a fixed scale. Unlike TryCreateThumbnail(), the result is not fit-to-bounds; the bitmap is sized to the document's ObjectList.AttributeBounds multiplied by
scale.PickNewSaveBackupFolder
#Ask the user to specify a new folder location for the BackupUserFolder. This method must be called on the UI thread.
Returns: True if a new folder was picked, false if otherwise.