public sealed record FileTransferRequest : IEquatable<FileTransferRequest> What to copy or move, and where.
Parameters
SourcesFully qualified paths of files, directories and symbolic links.
DestinationDirectoryThe existing directory that receives every source under its own name.
Constructors
FileTransferRequest
public FileTransferRequest(ImmutableArray<string> Sources, string DestinationDirectory) What to copy or move, and where.
Parameters
SourcesFully qualified paths of files, directories and symbolic links.
DestinationDirectoryThe existing directory that receives every source under its own name.
Properties
DestinationDirectory
public string DestinationDirectory { get; init; } The existing directory that receives every source under its own name.
Progress
public IProgress<FileTransferProgress>? Progress { get; init; } Receives progress about ten times a second and once when the transfer completes.
Remarks
Reports come from a worker thread. Progress created in a command forwards them to the command's context, such as a ViewModel's model context.
ResolveConflict
public FileConflictHandler? ResolveConflict { get; init; } Decides what to do when an entry of the destination has a source's name. Without a handler the transfer stops at the first conflict with PlatformFailureCode.Conflict, and nothing is replaced.
Remarks
The handler is called on the SynchronizationContext that was current when the transfer started, such as a ViewModel's model context in a command, otherwise on the thread pool, one conflict at a time. It can ask the user, for example through an interaction; the transfer waits for its answer. Its cancellation token is the transfer's.
Sources
public ImmutableArray<string> Sources { get; init; } Fully qualified paths of files, directories and symbolic links.