C# Class Cimbalino.Phone.Toolkit.Services.AsyncStorageService

Represents an implementation of the IAsyncStorageService.
Inheritance: IAsyncStorageService
Afficher le fichier Open project: Cimbalino/Cimbalino-Phone-Toolkit

Méthodes publiques

Méthode Description
AppendAllLines ( string path, IEnumerable contents ) : System.Threading.Tasks.Task

Appends lines to a file, and then closes the file.

AppendAllLines ( string path, IEnumerable contents, Encoding encoding ) : System.Threading.Tasks.Task

Appends lines to a file by using a specified encoding, and then closes the file.

AppendAllText ( string path, string contents ) : System.Threading.Tasks.Task

Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.

AppendAllText ( string path, string contents, Encoding encoding ) : System.Threading.Tasks.Task

Appends the specified string to the file, creating the file if it does not already exist.

CopyFileAsync ( string sourceFileName, string destinationFileName ) : System.Threading.Tasks.Task

Copies an existing file to a new file.

CopyFileAsync ( string sourceFileName, string destinationFileName, bool overwrite ) : System.Threading.Tasks.Task

Copies an existing file to a new file, and optionally overwrites an existing file.

CreateDirectoryAsync ( string dir ) : System.Threading.Tasks.Task

Creates a directory in the storage scope.

CreateFileAsync ( string path ) : Task

Creates a file in the store.

DeleteDirectoryAsync ( string dir ) : System.Threading.Tasks.Task

Deletes a directory in the storage scope.

DeleteFileAsync ( string path ) : System.Threading.Tasks.Task

Deletes the specified file.

DirectoryExistsAsync ( string dir ) : Task

Determines whether the specified path refers to an existing directory in the store.

FileExistsAsync ( string path ) : Task

Determines whether the specified path refers to an existing file in the store.

GetDirectoryNamesAsync ( ) : Task

Enumerates the directories in the root of a store.

GetDirectoryNamesAsync ( string searchPattern ) : Task

Enumerates directories in a storage scope that match a given pattern.

GetFileNamesAsync ( ) : Task

Obtains the names of files in the root of a store.

GetFileNamesAsync ( string searchPattern ) : Task

Enumerates files in storage scope that match a given pattern.

OpenFileForReadAsync ( string path ) : Task

Opens a file in the specified mode.

ReadAllBytesAsync ( string path ) : Task

Opens a binary file, reads the contents of the file into a byte array, and then closes the file. Returns null, if an exception is raised.

ReadAllLinesAsync ( string path ) : Task

Opens a text file, reads all lines of the file, and then closes the file.

ReadAllLinesAsync ( string path, Encoding encoding ) : Task

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.

ReadAllTextAsync ( string path ) : Task

Opens a text file, reads all lines of the file, and then closes the file.

ReadAllTextAsync ( string path, Encoding encoding ) : Task

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.

WriteAllBytesAsync ( string path, byte bytes ) : System.Threading.Tasks.Task

Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.

WriteAllLinesAsync ( string path, IEnumerable contents ) : System.Threading.Tasks.Task

Creates a new file, writes a collection of strings to the file, and then closes the file.

WriteAllLinesAsync ( string path, IEnumerable contents, Encoding encoding ) : System.Threading.Tasks.Task

Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.

WriteAllTextAsync ( string path, string contents ) : System.Threading.Tasks.Task

Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.

WriteAllTextAsync ( string path, string contents, Encoding encoding ) : System.Threading.Tasks.Task

Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.

Private Methods

Méthode Description
FilePatternToRegex ( string pattern ) : Regex

Method Details

AppendAllLines() public méthode

Appends lines to a file, and then closes the file.
public AppendAllLines ( string path, IEnumerable contents ) : System.Threading.Tasks.Task
path string The file to append the lines to. The file is created if it does not already exist.
contents IEnumerable The lines to append to the file.
Résultat System.Threading.Tasks.Task

AppendAllLines() public méthode

Appends lines to a file by using a specified encoding, and then closes the file.
public AppendAllLines ( string path, IEnumerable contents, Encoding encoding ) : System.Threading.Tasks.Task
path string The file to append the lines to. The file is created if it does not already exist.
contents IEnumerable The lines to append to the file.
encoding System.Text.Encoding The character encoding to use.
Résultat System.Threading.Tasks.Task

AppendAllText() public méthode

Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
public AppendAllText ( string path, string contents ) : System.Threading.Tasks.Task
path string The file to append the specified string to.
contents string The string to append to the file.
Résultat System.Threading.Tasks.Task

AppendAllText() public méthode

Appends the specified string to the file, creating the file if it does not already exist.
public AppendAllText ( string path, string contents, Encoding encoding ) : System.Threading.Tasks.Task
path string The file to append the specified string to.
contents string The string to append to the file.
encoding System.Text.Encoding The character encoding to use.
Résultat System.Threading.Tasks.Task

CopyFileAsync() public méthode

Copies an existing file to a new file.
public CopyFileAsync ( string sourceFileName, string destinationFileName ) : System.Threading.Tasks.Task
sourceFileName string The name of the file to copy.
destinationFileName string The name of the destination file. This cannot be a directory or an existing file.
Résultat System.Threading.Tasks.Task

CopyFileAsync() public méthode

Copies an existing file to a new file, and optionally overwrites an existing file.
public CopyFileAsync ( string sourceFileName, string destinationFileName, bool overwrite ) : System.Threading.Tasks.Task
sourceFileName string The name of the file to copy.
destinationFileName string The name of the destination file. This cannot be a directory.
overwrite bool true if the destination file can be overwritten; otherwise, false.
Résultat System.Threading.Tasks.Task

CreateDirectoryAsync() public méthode

Creates a directory in the storage scope.
public CreateDirectoryAsync ( string dir ) : System.Threading.Tasks.Task
dir string The relative path of the directory to create within the storage.
Résultat System.Threading.Tasks.Task

CreateFileAsync() public méthode

Creates a file in the store.
public CreateFileAsync ( string path ) : Task
path string The relative path of the file to be created in the store.
Résultat Task

DeleteDirectoryAsync() public méthode

Deletes a directory in the storage scope.
public DeleteDirectoryAsync ( string dir ) : System.Threading.Tasks.Task
dir string The relative path of the directory to delete within the storage scope.
Résultat System.Threading.Tasks.Task

DeleteFileAsync() public méthode

Deletes the specified file.
public DeleteFileAsync ( string path ) : System.Threading.Tasks.Task
path string The name of the file to be deleted. Wildcard characters are not supported.
Résultat System.Threading.Tasks.Task

DirectoryExistsAsync() public méthode

Determines whether the specified path refers to an existing directory in the store.
public DirectoryExistsAsync ( string dir ) : Task
dir string The path to test.
Résultat Task

FileExistsAsync() public méthode

Determines whether the specified path refers to an existing file in the store.
public FileExistsAsync ( string path ) : Task
path string The path and file name to test.
Résultat Task

GetDirectoryNamesAsync() public méthode

Enumerates the directories in the root of a store.
public GetDirectoryNamesAsync ( ) : Task
Résultat Task

GetDirectoryNamesAsync() public méthode

Enumerates directories in a storage scope that match a given pattern.
public GetDirectoryNamesAsync ( string searchPattern ) : Task
searchPattern string A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported.
Résultat Task

GetFileNamesAsync() public méthode

Obtains the names of files in the root of a store.
public GetFileNamesAsync ( ) : Task
Résultat Task

GetFileNamesAsync() public méthode

Enumerates files in storage scope that match a given pattern.
public GetFileNamesAsync ( string searchPattern ) : Task
searchPattern string A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported.
Résultat Task

OpenFileForReadAsync() public méthode

Opens a file in the specified mode.
public OpenFileForReadAsync ( string path ) : Task
path string The relative path of the file within the store.
Résultat Task

ReadAllBytesAsync() public méthode

Opens a binary file, reads the contents of the file into a byte array, and then closes the file. Returns null, if an exception is raised.
public ReadAllBytesAsync ( string path ) : Task
path string The file to open for reading.
Résultat Task

ReadAllLinesAsync() public méthode

Opens a text file, reads all lines of the file, and then closes the file.
public ReadAllLinesAsync ( string path ) : Task
path string The file to open for reading.
Résultat Task

ReadAllLinesAsync() public méthode

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
public ReadAllLinesAsync ( string path, Encoding encoding ) : Task
path string The file to open for reading.
encoding System.Text.Encoding The encoding applied to the contents of the file.
Résultat Task

ReadAllTextAsync() public méthode

Opens a text file, reads all lines of the file, and then closes the file.
public ReadAllTextAsync ( string path ) : Task
path string The file to open for reading.
Résultat Task

ReadAllTextAsync() public méthode

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
public ReadAllTextAsync ( string path, Encoding encoding ) : Task
path string The file to open for reading.
encoding System.Text.Encoding The encoding applied to the contents of the file.
Résultat Task

WriteAllBytesAsync() public méthode

Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.
public WriteAllBytesAsync ( string path, byte bytes ) : System.Threading.Tasks.Task
path string The file to write to.
bytes byte The bytes to write to the file.
Résultat System.Threading.Tasks.Task

WriteAllLinesAsync() public méthode

Creates a new file, writes a collection of strings to the file, and then closes the file.
public WriteAllLinesAsync ( string path, IEnumerable contents ) : System.Threading.Tasks.Task
path string The file to write to.
contents IEnumerable The lines to write to the file.
Résultat System.Threading.Tasks.Task

WriteAllLinesAsync() public méthode

Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.
public WriteAllLinesAsync ( string path, IEnumerable contents, Encoding encoding ) : System.Threading.Tasks.Task
path string The file to write to.
contents IEnumerable The lines to write to the file.
encoding System.Text.Encoding The character encoding to use.
Résultat System.Threading.Tasks.Task

WriteAllTextAsync() public méthode

Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.
public WriteAllTextAsync ( string path, string contents ) : System.Threading.Tasks.Task
path string The file to write to.
contents string The string to write to the file.
Résultat System.Threading.Tasks.Task

WriteAllTextAsync() public méthode

Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.
public WriteAllTextAsync ( string path, string contents, Encoding encoding ) : System.Threading.Tasks.Task
path string The file to write to.
contents string The string to write to the file.
encoding System.Text.Encoding The encoding to apply to the string.
Résultat System.Threading.Tasks.Task