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

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

Public Methods

Method 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

Method 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 method

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

AppendAllLines() public static method

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

AppendAllLinesAsync() public static method

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.
return System.Threading.Tasks.Task

AppendAllLinesAsync() public static method

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.
return System.Threading.Tasks.Task

AppendAllText() public static method

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

AppendAllText() public static method

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

AppendAllTextAsync() public static method

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.
return System.Threading.Tasks.Task

AppendAllTextAsync() public static method

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.
return System.Threading.Tasks.Task

DeleteDirectory() public static method

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

ReadAllBytes() public static method

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.
return byte[]

ReadAllBytesAsync() public static method

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

ReadAllLines() public static method

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.
return string[]

ReadAllLines() public static method

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.
return string[]

ReadAllLinesAsync() public static method

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

ReadAllLinesAsync() public static method

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

ReadAllText() public static method

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

ReadAllText() public static method

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

ReadAllTextAsync() public static method

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

ReadAllTextAsync() public static method

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

ReadLines() public static method

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

ReadLines() public static method

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

WriteAllBytes() public static method

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

WriteAllBytesAsync() public static method

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.
return System.Threading.Tasks.Task

WriteAllLines() public static method

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

WriteAllLines() public static method

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

WriteAllLinesAsync() public static method

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.
return System.Threading.Tasks.Task

WriteAllLinesAsync() public static method

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.
return System.Threading.Tasks.Task

WriteAllText() public static method

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

WriteAllText() public static method

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

WriteAllTextAsync() public static method

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.
return System.Threading.Tasks.Task

WriteAllTextAsync() public static method

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.
return System.Threading.Tasks.Task