FileCopyCopyTo Method
Asynchronously copies the source file to the specified destination.
Namespace: DevCase.Core.IO.FileSystemAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public virtual CancellationTokenSource CopyTo(
string targetFilepath,
int bufferSize = 1024,
bool overwrite = false,
bool deleteFileOnCancel = false,
Action cancelCallback = null
)
Public Overridable Function CopyTo (
targetFilepath As String,
Optional bufferSize As Integer = 1024,
Optional overwrite As Boolean = false,
Optional deleteFileOnCancel As Boolean = false,
Optional cancelCallback As Action = Nothing
) As CancellationTokenSource
Dim instance As FileCopy
Dim targetFilepath As String
Dim bufferSize As Integer
Dim overwrite As Boolean
Dim deleteFileOnCancel As Boolean
Dim cancelCallback As Action
Dim returnValue As CancellationTokenSource
returnValue = instance.CopyTo(targetFilepath,
bufferSize, overwrite, deleteFileOnCancel,
cancelCallback)
public:
virtual CancellationTokenSource^ CopyTo(
String^ targetFilepath,
int bufferSize = 1024,
bool overwrite = false,
bool deleteFileOnCancel = false,
Action^ cancelCallback = nullptr
)
abstract CopyTo :
targetFilepath : string *
?bufferSize : int *
?overwrite : bool *
?deleteFileOnCancel : bool *
?cancelCallback : Action
(* Defaults:
let _bufferSize = defaultArg bufferSize 1024
let _overwrite = defaultArg overwrite false
let _deleteFileOnCancel = defaultArg deleteFileOnCancel false
let _cancelCallback = defaultArg cancelCallback null
*)
-> CancellationTokenSource
override CopyTo :
targetFilepath : string *
?bufferSize : int *
?overwrite : bool *
?deleteFileOnCancel : bool *
?cancelCallback : Action
(* Defaults:
let _bufferSize = defaultArg bufferSize 1024
let _overwrite = defaultArg overwrite false
let _deleteFileOnCancel = defaultArg deleteFileOnCancel false
let _cancelCallback = defaultArg cancelCallback null
*)
-> CancellationTokenSource
No code example is currently available or this language may not be supported.
- targetFilepath String
-
The target filepath.
- bufferSize Int32 (Optional)
-
The size, in bytes, of the internal FileStream buffer that is used to copy.
- overwrite Boolean (Optional)
-
If set to , overwrites any existing file,
otherwise, a IOException exception is thrown.
- deleteFileOnCancel Boolean (Optional)
-
If set to , deletes the target file if the copy operation was cancelled
- cancelCallback Action (Optional)
-
A encapsulated method that is called if the copy operation is cancelled.
CancellationTokenSource
A
CancellationTokenSource instance to cancel the file-copy task at any moment.
This value can be pass to the
CancelCopy(CancellationTokenSource).
FileNotFoundException
|
File not found.;targetFilepath
|
IOException
|
Target file already exists.
|
ArgumentException
|
Positive value is required.;bufferSize
|