C# Class Cimbalino.Phone.Toolkit.Extensions.IsolatedStorageFileExtensions

Provides a set of static (Shared in Visual Basic) methods for IsolatedStorageFile instances.
Afficher le fichier Open project: Cimbalino/Cimbalino-Phone-Toolkit

Méthodes publiques

Méthode Description
AppendAllLines ( this store, string path, IEnumerable contents ) : void

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

AppendAllLines ( this store, string path, IEnumerable contents, Encoding encoding ) : void

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

AppendAllLinesAsync ( this store, string path, IEnumerable contents ) : System.Threading.Tasks.Task

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

AppendAllLinesAsync ( this store, 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 ( this store, string path, string contents ) : void

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 ( this store, string path, string contents, Encoding encoding ) : void

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

AppendAllTextAsync ( this store, 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.

AppendAllTextAsync ( this store, 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.

DeleteDirectory ( this store, string path, bool recursive ) : void

Deletes the specified directory and, if indicated, any subdirectories and files in the directory.

ReadAllBytes ( this store, string path ) : byte[]

Opens a binary file, reads the contents of the file into a byte array, and then closes the file.

ReadAllBytesAsync ( this store, string path ) : Task

Opens a binary file, reads the contents of the file into a byte array, and then closes the file.

ReadAllLines ( this store, string path ) : string[]

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

ReadAllLines ( this store, string path, Encoding encoding ) : string[]

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

ReadAllLinesAsync ( this store, string path ) : Task

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

ReadAllLinesAsync ( this store, string path, Encoding encoding ) : Task

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

ReadAllText ( this store, string path ) : string

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

ReadAllText ( this store, string path, Encoding encoding ) : string

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

ReadAllTextAsync ( this store, string path ) : Task

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

ReadAllTextAsync ( this store, string path, Encoding encoding ) : Task

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

ReadLines ( this store, string path ) : IEnumerable

Reads the lines of a file.

ReadLines ( this store, string path, Encoding encoding ) : IEnumerable

Reads the lines of a file that has a specified encoding.

WriteAllBytes ( this store, string path, byte bytes ) : void

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..

WriteAllBytesAsync ( this store, 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..

WriteAllLines ( this store, string path, IEnumerable contents ) : void

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

WriteAllLines ( this store, string path, IEnumerable contents, Encoding encoding ) : void

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

WriteAllLinesAsync ( this store, 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 ( this store, 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.

WriteAllText ( this store, string path, string contents ) : void

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.

WriteAllText ( this store, string path, string contents, Encoding encoding ) : void

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.

WriteAllTextAsync ( this store, 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 ( this store, 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
InternalWriteAllLines ( IsolatedStorageFileStream fileStream, IEnumerable contents, Encoding encoding ) : void
InternalWriteAllLinesAsync ( IsolatedStorageFileStream fileStream, IEnumerable contents, Encoding encoding ) : System.Threading.Tasks.Task
InternalWriteAllText ( IsolatedStorageFileStream fileStream, string contents, Encoding encoding ) : void
InternalWriteAllTextAsync ( IsolatedStorageFileStream fileStream, string contents, Encoding encoding ) : System.Threading.Tasks.Task

Method Details

AppendAllLines() public static méthode

Appends lines to a file, and then closes the file.
public static AppendAllLines ( this store, string path, IEnumerable contents ) : void
store this The object.
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 void

AppendAllLines() public static méthode

Appends lines to a file by using a specified encoding, and then closes the file.
public static AppendAllLines ( this store, string path, IEnumerable contents, Encoding encoding ) : void
store this The object.
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 void

AppendAllLinesAsync() public static méthode

Appends lines to a file, and then closes the file.
public static AppendAllLinesAsync ( this store, string path, IEnumerable contents ) : System.Threading.Tasks.Task
store this The object.
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

AppendAllLinesAsync() public static méthode

Appends lines to a file by using a specified encoding, and then closes the file.
public static AppendAllLinesAsync ( this store, string path, IEnumerable contents, Encoding encoding ) : System.Threading.Tasks.Task
store this The object.
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 static 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 static AppendAllText ( this store, string path, string contents ) : void
store this The object.
path string The file to append the specified string to.
contents string The string to append to the file.
Résultat void

AppendAllText() public static méthode

Appends the specified string to the file, creating the file if it does not already exist.
public static AppendAllText ( this store, string path, string contents, Encoding encoding ) : void
store this The object.
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 void

AppendAllTextAsync() public static 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 static AppendAllTextAsync ( this store, string path, string contents ) : System.Threading.Tasks.Task
store this The object.
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

AppendAllTextAsync() public static méthode

Appends the specified string to the file, creating the file if it does not already exist.
public static AppendAllTextAsync ( this store, string path, string contents, Encoding encoding ) : System.Threading.Tasks.Task
store this The object.
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

DeleteDirectory() public static méthode

Deletes the specified directory and, if indicated, any subdirectories and files in the directory.
public static DeleteDirectory ( this store, string path, bool recursive ) : void
store this The object.
path string The relative path of the directory to delete within the isolated storage scope.
recursive bool true to remove directories, subdirectories, and files in path; otherwise, false.
Résultat void

ReadAllBytes() public static méthode

Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
public static ReadAllBytes ( this store, string path ) : byte[]
store this The object.
path string The file to open for reading.
Résultat byte[]

ReadAllBytesAsync() public static méthode

Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
public static ReadAllBytesAsync ( this store, string path ) : Task
store this The object.
path string The file to open for reading.
Résultat Task

ReadAllLines() public static méthode

Opens a text file, reads all lines of the file, and then closes the file.
public static ReadAllLines ( this store, string path ) : string[]
store this The object.
path string The file to open for reading.
Résultat string[]

ReadAllLines() public static méthode

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
public static ReadAllLines ( this store, string path, Encoding encoding ) : string[]
store this The object.
path string The file to open for reading.
encoding System.Text.Encoding The encoding applied to the contents of the file.
Résultat string[]

ReadAllLinesAsync() public static méthode

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

ReadAllLinesAsync() public static méthode

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

ReadAllText() public static méthode

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

ReadAllText() public static méthode

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

ReadAllTextAsync() public static méthode

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

ReadAllTextAsync() public static méthode

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

ReadLines() public static méthode

Reads the lines of a file.
public static ReadLines ( this store, string path ) : IEnumerable
store this The object.
path string The file to read.
Résultat IEnumerable

ReadLines() public static méthode

Reads the lines of a file that has a specified encoding.
public static ReadLines ( this store, string path, Encoding encoding ) : IEnumerable
store this The object.
path string The file to read.
encoding System.Text.Encoding The encoding that is applied to the contents of the file.
Résultat IEnumerable

WriteAllBytes() public static 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 static WriteAllBytes ( this store, string path, byte bytes ) : void
store this The object.
path string The file to write to.
bytes byte The bytes to write to the file.
Résultat void

WriteAllBytesAsync() public static 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 static WriteAllBytesAsync ( this store, string path, byte bytes ) : System.Threading.Tasks.Task
store this The object.
path string The file to write to.
bytes byte The bytes to write to the file.
Résultat System.Threading.Tasks.Task

WriteAllLines() public static méthode

Creates a new file, writes a collection of strings to the file, and then closes the file.
public static WriteAllLines ( this store, string path, IEnumerable contents ) : void
store this The object.
path string The file to write to.
contents IEnumerable The lines to write to the file.
Résultat void

WriteAllLines() public static 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 static WriteAllLines ( this store, string path, IEnumerable contents, Encoding encoding ) : void
store this The object.
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 void

WriteAllLinesAsync() public static méthode

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

WriteAllLinesAsync() public static 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 static WriteAllLinesAsync ( this store, string path, IEnumerable contents, Encoding encoding ) : System.Threading.Tasks.Task
store this The object.
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

WriteAllText() public static 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 static WriteAllText ( this store, string path, string contents ) : void
store this The object.
path string The file to write to.
contents string The string to write to the file.
Résultat void

WriteAllText() public static 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 static WriteAllText ( this store, string path, string contents, Encoding encoding ) : void
store this The object.
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 void

WriteAllTextAsync() public static 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 static WriteAllTextAsync ( this store, string path, string contents ) : System.Threading.Tasks.Task
store this The object.
path string The file to write to.
contents string The string to write to the file.
Résultat System.Threading.Tasks.Task

WriteAllTextAsync() public static 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 static WriteAllTextAsync ( this store, string path, string contents, Encoding encoding ) : System.Threading.Tasks.Task
store this The object.
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