public class FileOperation : IDisposable
Public Class FileOperation
Implements IDisposable
Dim instance As FileOperation
public ref class FileOperation : IDisposable
type FileOperation =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
' Declare and create the test source directory.
Dim srcDir As New DirectoryInfo("C:\Test_Source_Directory")
srcDir.Create()
Dim fsOperation As New FileOperation(DirectCast(Me, IWin32Window)) With {
.OperationFlags = FileOperationFlags.AddUndoRecord Or
FileOperationFlags.NoConfirmMakeDir Or
FileOperationFlags.RecycleOnDelete Or
FileOperationFlags.RenameCollision Or
FileOperationFlags.PreserveFileExtensions
}
' Queue a copy of test directory into its own directory.
fsOperation.QueueCopy(srcDir)
' Queue a copy of test directory the temp directory.
fsOperation.QueueCopy(srcDir, New DirectoryInfo(Path.GetTempPath), "NewDirName")
' Perform the queued copy operations.
Dim result As HResult = fsOperation.PerformOperations()
If result <> HResult.S_OK Then
Throw Marshal.GetExceptionForHR(result)
End If
Dim isAborted As Boolean = fsOperation.IsOperationAborted()
If isAborted Then
Console.WriteLine("Operation was aborted by the user.")
Else
Console.WriteLine("Operation was completed.")
End If
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
FileOperation | Initializes a new instance of the FileOperation class. |
FileOperation(FileOperationProgressSink) | Initializes a new instance of the FileOperation class. |
FileOperation(IWin32Window) | Initializes a new instance of the FileOperation class. |
FileOperation(FileOperationProgressSink, IWin32Window) | Initializes a new instance of the FileOperation class. |
OperationFlags | Gets or sets the flags that control the file operation when calling PerformOperations function. |
Dispose | Releases all the resources used by this instance. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
IsOperationAborted | Gets a value that states whether any file operations initiated by a call to PerformOperations were stopped before they were complete. The operations could be stopped either by user action or silently by the system. |
PerformOperations | Executes all the queued operations. |
QueueCopy(DirectoryInfo, String) | Queues a copy operation of a source directory into its own directory. |
QueueCopy(FileInfo, FileInfo) | Queues a copy operation of a source file to a destination file. |
QueueCopy(FileInfo, String) | Queues a copy operation of a source file into its own directory. |
QueueCopy(DirectoryInfo, DirectoryInfo, String) | Queues a copy operation of a source directory to a destination directory. |
QueueCopy(DirectoryInfo, String, String) | Queues a copy operation of a source directory to a destination directory. |
QueueCopy(FileInfo, DirectoryInfo, String) | Queues a copy operation of a source file to a destination directory. |
QueueCopy(FileInfo, String, String) | Queues a copy operation of a source file to a destination directory. |
QueueCopy(String, DirectoryInfo, String) | Queues a copy operation of a source file or directory to a destination directory. |
QueueCopy(String, String, String) | Queues a copy operation of a source file or directory to a destination directory. |
QueueCreate(DirectoryInfo, FileAttributes) | Queues a create operation for a directory. |
QueueCreate(FileInfo, FileAttributes) | Queues a create operation for a file. |
QueueCreate(String, String, FileAttributes) | Queues a create operation for a file or directory. |
QueueDelete(DirectoryInfo) | Queues a delete operation for a directory. |
QueueDelete(FileInfo) | Queues a delete operation for a file. |
QueueDelete(String) | Queues a delete operation for a file or directory. |
QueueMove(FileInfo, FileInfo) | Queues a move operation of a source file to a destination file. |
QueueMove(DirectoryInfo, DirectoryInfo, String) | Queues a move operation of a source directory to a destination directory. |
QueueMove(DirectoryInfo, String, String) | Queues a move operation of a source directory to a destination directory. |
QueueMove(FileInfo, DirectoryInfo, String) | Queues a move operation of a source file to a destination directory. |
QueueMove(FileInfo, String, String) | Queues a move operation of a source file to a destination directory. |
QueueMove(String, DirectoryInfo, String) | Queues a move operation of a source file or directory to a destination directory. |
QueueMove(String, String, String) | Queues a move operation of a source file or directory to a destination directory. |
QueueRename(DirectoryInfo, String) | Queues a rename operation for a directory. |
QueueRename(FileInfo, String, String) | Queues a rename operation for a file. |
QueueRename(String, String, String) | Queues a rename operation for a file or directory. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |