C# Class InTheHand.Storage.StorageFile

Represents a file. Provides information about the file and its content, and ways to manipulate them.
PlatformVersion supported AndroidAndroid 4.4 and later iOSiOS 9.0 and later tvOStvOS 9.0 and later TizenTizen 3.0 Windows UWPWindows 10 Windows StoreWindows 8.1 or later Windows Phone StoreWindows Phone 8.1 or later Windows Phone SilverlightWindows Phone 8.0 or later Windows (Desktop Apps)Windows Vista or later
Inheritance: IStorageFile, IStorageItem, IStorageItem2
Mostrar archivo Open project: inthehand/Charming Class Usage Examples

Public Methods

Method Description
CopyAndReplaceAsync ( IStorageFile fileToReplace ) : System.Threading.Tasks.Task

Replaces the specified file with a copy of the current file.

CopyAsync ( IStorageFolder destinationFolder ) : Task

Creates a copy of the file in the specified folder.

CopyAsync ( IStorageFolder destinationFolder, string desiredNewName ) : Task

Creates a copy of the file in the specified folder and renames the copy.

DeleteAsync ( ) : System.Threading.Tasks.Task

Deletes the current file.

DeleteAsync ( StorageDeleteOption option ) : System.Threading.Tasks.Task

Deletes the current file, optionally deleting the item permanently.

GetBasicPropertiesAsync ( ) : Task

Gets the basic properties of the current file.

GetFileFromPathAsync ( string path ) : Task

Gets a StorageFile object to represent the file at the specified path.

GetParentAsync ( ) : Task

Gets the parent folder of the current file.

IsEqual ( IStorageItem item ) : bool

Indicates whether the current file is equal to the specified file.

IsOfType ( StorageItemTypes type ) : bool

Determines whether the current StorageFile matches the specified StorageItemTypes value.

MoveAndReplaceAsync ( IStorageFile fileToReplace ) : System.Threading.Tasks.Task

Moves the current file to the location of the specified file and replaces the specified file in that location.

MoveAsync ( IStorageFolder destinationFolder ) : System.Threading.Tasks.Task

Moves the current file to the specified folder and renames the file according to the desired name.

MoveAsync ( IStorageFolder destinationFolder, string desiredNewName ) : System.Threading.Tasks.Task

Moves the current file to the specified folder and renames the file according to the desired name.

RenameAsync ( string desiredName ) : System.Threading.Tasks.Task

Renames the current file.

RenameAsync ( string desiredName, NameCollisionOption option ) : System.Threading.Tasks.Task

Renames the current file. This method also specifies what to do if an existing item in the current file's location has the same name.

Private Methods

Method Description
StorageFile ( Windows file ) : System
StorageFile ( string path ) : System

Method Details

CopyAndReplaceAsync() public method

Replaces the specified file with a copy of the current file.
public CopyAndReplaceAsync ( IStorageFile fileToReplace ) : System.Threading.Tasks.Task
fileToReplace IStorageFile
return System.Threading.Tasks.Task

CopyAsync() public method

Creates a copy of the file in the specified folder.
public CopyAsync ( IStorageFolder destinationFolder ) : Task
destinationFolder IStorageFolder The destination folder where the copy of the file is created.
return Task

CopyAsync() public method

Creates a copy of the file in the specified folder and renames the copy.
public CopyAsync ( IStorageFolder destinationFolder, string desiredNewName ) : Task
destinationFolder IStorageFolder The destination folder where the copy of the file is created.
desiredNewName string The new name for the copy of the file created in the destinationFolder.
return Task

DeleteAsync() public method

Deletes the current file.
public DeleteAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

DeleteAsync() public method

Deletes the current file, optionally deleting the item permanently.
public DeleteAsync ( StorageDeleteOption option ) : System.Threading.Tasks.Task
option StorageDeleteOption
return System.Threading.Tasks.Task

GetBasicPropertiesAsync() public method

Gets the basic properties of the current file.
public GetBasicPropertiesAsync ( ) : Task
return Task

GetFileFromPathAsync() public static method

Gets a StorageFile object to represent the file at the specified path.
public static GetFileFromPathAsync ( string path ) : Task
path string The path of the file to get a StorageFile to represent. /// If your path uses slashes, make sure you use backslashes(\). /// Forward slashes(/) are not accepted by this method.
return Task

GetParentAsync() public method

Gets the parent folder of the current file.
public GetParentAsync ( ) : Task
return Task

IsEqual() public method

Indicates whether the current file is equal to the specified file.
public IsEqual ( IStorageItem item ) : bool
item IStorageItem The object that represents a file to compare against.
return bool

IsOfType() public method

Determines whether the current StorageFile matches the specified StorageItemTypes value.
public IsOfType ( StorageItemTypes type ) : bool
type StorageItemTypes The value to match against.
return bool

MoveAndReplaceAsync() public method

Moves the current file to the location of the specified file and replaces the specified file in that location.
public MoveAndReplaceAsync ( IStorageFile fileToReplace ) : System.Threading.Tasks.Task
fileToReplace IStorageFile The file to replace.
return System.Threading.Tasks.Task

MoveAsync() public method

Moves the current file to the specified folder and renames the file according to the desired name.
public MoveAsync ( IStorageFolder destinationFolder ) : System.Threading.Tasks.Task
destinationFolder IStorageFolder The destination folder where the file is moved.
return System.Threading.Tasks.Task

MoveAsync() public method

Moves the current file to the specified folder and renames the file according to the desired name.
public MoveAsync ( IStorageFolder destinationFolder, string desiredNewName ) : System.Threading.Tasks.Task
destinationFolder IStorageFolder The destination folder where the file is moved.
desiredNewName string The desired name of the file after it is moved.
return System.Threading.Tasks.Task

RenameAsync() public method

Renames the current file.
public RenameAsync ( string desiredName ) : System.Threading.Tasks.Task
desiredName string The desired, new name of the current item.
return System.Threading.Tasks.Task

RenameAsync() public method

Renames the current file. This method also specifies what to do if an existing item in the current file's location has the same name.
public RenameAsync ( string desiredName, NameCollisionOption option ) : System.Threading.Tasks.Task
desiredName string The desired, new name of the current file. /// If there is an existing item in the current file's location that already has the specified desiredName, the specified determines how the system responds to the conflict.
option NameCollisionOption The enum value that determines how the system responds if the desiredName is the same as the name of an existing item in the current file's location.
return System.Threading.Tasks.Task