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
Afficher le fichier Open project: inthehand/Charming Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
StorageFile ( Windows file ) : System
StorageFile ( string path ) : System

Method Details

CopyAndReplaceAsync() public méthode

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

CopyAsync() public méthode

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.
Résultat Task

CopyAsync() public méthode

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.
Résultat Task

DeleteAsync() public méthode

Deletes the current file.
public DeleteAsync ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task

DeleteAsync() public méthode

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

GetBasicPropertiesAsync() public méthode

Gets the basic properties of the current file.
public GetBasicPropertiesAsync ( ) : Task
Résultat Task

GetFileFromPathAsync() public static méthode

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.
Résultat Task

GetParentAsync() public méthode

Gets the parent folder of the current file.
public GetParentAsync ( ) : Task
Résultat Task

IsEqual() public méthode

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.
Résultat bool

IsOfType() public méthode

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

MoveAndReplaceAsync() public méthode

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.
Résultat System.Threading.Tasks.Task

MoveAsync() public méthode

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.
Résultat System.Threading.Tasks.Task

MoveAsync() public méthode

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.
Résultat System.Threading.Tasks.Task

RenameAsync() public méthode

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

RenameAsync() public méthode

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.
Résultat System.Threading.Tasks.Task