Gorgon
Show / Hide Table of Contents

Class GorgonCopyCallbackOptions

Callback options for copying a directory or file.

Inheritance
object
GorgonCopyCallbackOptions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
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 Source

CancelToken

Property to set or return the cancelation token for the copy operation.

Declaration
public CancellationToken CancelToken { get; set; }
Property Value
Type Description
CancellationToken
| Edit this page View Source

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
FileConflictResolution
| Edit this page View Source

ProgressCallback

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).

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author