Class GorgonCopyCallbackOptions
Callback options for copying a directory or file.
Inherited Members
Namespace: Gorgon.IO
Assembly: Gorgon.FileSystem.dll
Syntax
public class GorgonCopyCallbackOptions
Remarks
This is used to perform the copy with progress reporting, overwrite options, and cancelation support for long running operations.
The typical use case for these callbacks/cancelation support is with a UI that reports progress, and allows the user to determine how to handle file overwriting. The cancellation support is provided for asynchronous copying, especially in cases where lots of data is being copied and a considerable amount of time is consumed during the copy.
Properties
| Edit this page View SourceCancelToken
Property to set or return the cancelation token for the copy operation.
Declaration
public CancellationToken CancelToken { get; set; }
Property Value
Type | Description |
---|---|
CancellationToken |
ConflictResolutionCallback
Property to set or return the callback used to handle a conflict where the source file shares the same name as the destination file.
Declaration
public Func<string, string, FileConflictResolution> ConflictResolutionCallback { get; set; }
Property Value
Type | Description |
---|---|
Func<string, string, FileConflictResolution> |
Remarks
This callback method takes 2 parameters. The first is the full path to the file being copied, and the second is the destination file path. The return value of the callback method is a FileConflictResolution enumeration type which tells the copy operation how to handle the conflict.
See Also
| Edit this page View SourceProgressCallback
Property to set or return the callback used to report copy progress.
Declaration
public Action<string, double> ProgressCallback { get; set; }
Property Value
Type | Description |
---|---|
Action<string, double> |
Remarks
This callback method takes two parameters. The first is the full path to the directory or file being copied, and the second reports the total number of bytes copied for a given file as a normalized percentage (e.g. 0 - 1.0).