C# 클래스 Cimbalino.Phone.Toolkit.Services.StorageService

Represents an implementation of the IStorageService.
상속: IStorageService
파일 보기 프로젝트 열기: Cimbalino/Cimbalino-Phone-Toolkit

공개 메소드들

메소드 설명
AppendAllLines ( string path, IEnumerable contents ) : void

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

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

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

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

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

CopyFile ( string sourceFileName, string destinationFileName ) : void

Copies an existing file to a new file.

CopyFile ( string sourceFileName, string destinationFileName, bool overwrite ) : void

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

CreateDirectory ( string dir ) : void

Creates a directory in the storage scope.

CreateFile ( string path ) : Stream

Creates a file in the store.

DeleteDirectory ( string dir ) : void

Deletes a directory in the storage scope.

DeleteFile ( string path ) : void

Deletes the specified file.

DirectoryExists ( string dir ) : bool

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

FileExists ( string path ) : bool

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

GetDirectoryNames ( ) : string[]

Enumerates the directories in the root of a store.

GetDirectoryNames ( string searchPattern ) : string[]

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

GetFileNames ( ) : string[]

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

GetFileNames ( string searchPattern ) : string[]

Enumerates files in storage scope that match a given pattern.

IncreaseQuotaTo ( long newQuotaSize ) : bool

Enables an application to explicitly request a larger quota size, in bytes.

MoveDirectory ( string sourceDirectoryName, string destinationDirectoryName ) : void

Moves a specified directory and its contents to a new location.

MoveFile ( string sourceFileName, string destinationFileName ) : void

Moves a specified file to a new location, and optionally lets you specify a new file name.

OpenFile ( string path, FileMode mode ) : Stream

Opens a file in the specified mode.

OpenFile ( string path, FileMode mode, FileAccess access ) : Stream

Opens a file in the specified mode with the specified file access.

OpenFile ( string path, FileMode mode, FileAccess access, FileShare share ) : Stream

Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.

ReadAllBytes ( string path ) : byte[]

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.

ReadAllLines ( string path ) : string[]

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

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

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

ReadAllText ( string path ) : string

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

ReadAllText ( string path, Encoding encoding ) : string

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

ReadLines ( string path ) : IEnumerable

Reads the lines of a file.

ReadLines ( string path, Encoding encoding ) : IEnumerable

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

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

WriteAllLines ( string path, IEnumerable contents ) : void

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

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

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

메소드 상세

AppendAllLines() 공개 메소드

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

AppendAllLines() 공개 메소드

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

AppendAllText() 공개 메소드

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 ) : void
path string The file to append the specified string to.
contents string The string to append to the file.
리턴 void

AppendAllText() 공개 메소드

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

CopyFile() 공개 메소드

Copies an existing file to a new file.
public CopyFile ( string sourceFileName, string destinationFileName ) : void
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.
리턴 void

CopyFile() 공개 메소드

Copies an existing file to a new file, and optionally overwrites an existing file.
public CopyFile ( string sourceFileName, string destinationFileName, bool overwrite ) : void
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.
리턴 void

CreateDirectory() 공개 메소드

Creates a directory in the storage scope.
public CreateDirectory ( string dir ) : void
dir string The relative path of the directory to create within the storage.
리턴 void

CreateFile() 공개 메소드

Creates a file in the store.
public CreateFile ( string path ) : Stream
path string The relative path of the file to be created in the store.
리턴 System.IO.Stream

DeleteDirectory() 공개 메소드

Deletes a directory in the storage scope.
public DeleteDirectory ( string dir ) : void
dir string The relative path of the directory to delete within the storage scope.
리턴 void

DeleteFile() 공개 메소드

Deletes the specified file.
public DeleteFile ( string path ) : void
path string The name of the file to be deleted. Wildcard characters are not supported.
리턴 void

DirectoryExists() 공개 메소드

Determines whether the specified path refers to an existing directory in the store.
public DirectoryExists ( string dir ) : bool
dir string The path to test.
리턴 bool

FileExists() 공개 메소드

Determines whether the specified path refers to an existing file in the store.
public FileExists ( string path ) : bool
path string The path and file name to test.
리턴 bool

GetDirectoryNames() 공개 메소드

Enumerates the directories in the root of a store.
public GetDirectoryNames ( ) : string[]
리턴 string[]

GetDirectoryNames() 공개 메소드

Enumerates directories in a storage scope that match a given pattern.
public GetDirectoryNames ( string searchPattern ) : string[]
searchPattern string A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported.
리턴 string[]

GetFileNames() 공개 메소드

Obtains the names of files in the root of a store.
public GetFileNames ( ) : string[]
리턴 string[]

GetFileNames() 공개 메소드

Enumerates files in storage scope that match a given pattern.
public GetFileNames ( string searchPattern ) : string[]
searchPattern string A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported.
리턴 string[]

IncreaseQuotaTo() 공개 메소드

Enables an application to explicitly request a larger quota size, in bytes.
public IncreaseQuotaTo ( long newQuotaSize ) : bool
newQuotaSize long The requested size, in bytes.
리턴 bool

MoveDirectory() 공개 메소드

Moves a specified directory and its contents to a new location.
public MoveDirectory ( string sourceDirectoryName, string destinationDirectoryName ) : void
sourceDirectoryName string The name of the directory to move.
destinationDirectoryName string The path to the new location for sourceDirectoryName. This cannot be the path to an existing directory.
리턴 void

MoveFile() 공개 메소드

Moves a specified file to a new location, and optionally lets you specify a new file name.
public MoveFile ( string sourceFileName, string destinationFileName ) : void
sourceFileName string The name of the file to move.
destinationFileName string The path to the new location for the file. If a file name is included, the moved file will have that name.
리턴 void

OpenFile() 공개 메소드

Opens a file in the specified mode.
public OpenFile ( string path, FileMode mode ) : Stream
path string The relative path of the file within the store.
mode FileMode The mode in which to open the file.
리턴 System.IO.Stream

OpenFile() 공개 메소드

Opens a file in the specified mode with the specified file access.
public OpenFile ( string path, FileMode mode, FileAccess access ) : Stream
path string The relative path of the file within the store.
mode FileMode The mode in which to open the file.
access FileAccess The type of access to open the file with.
리턴 System.IO.Stream

OpenFile() 공개 메소드

Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.
public OpenFile ( string path, FileMode mode, FileAccess access, FileShare share ) : Stream
path string The relative path of the file within the store.
mode FileMode The mode in which to open the file.
access FileAccess The type of access to open the file with.
share FileShare The type of access other objects have to this file.
리턴 System.IO.Stream

ReadAllBytes() 공개 메소드

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 ReadAllBytes ( string path ) : byte[]
path string The file to open for reading.
리턴 byte[]

ReadAllLines() 공개 메소드

Opens a text file, reads all lines of the file, and then closes the file.
public ReadAllLines ( string path ) : string[]
path string The file to open for reading.
리턴 string[]

ReadAllLines() 공개 메소드

Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
public ReadAllLines ( string path, Encoding encoding ) : string[]
path string The file to open for reading.
encoding System.Text.Encoding The encoding applied to the contents of the file.
리턴 string[]

ReadAllText() 공개 메소드

Opens a text file, reads all lines of the file, and then closes the file.
public ReadAllText ( string path ) : string
path string The file to open for reading.
리턴 string

ReadAllText() 공개 메소드

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

ReadLines() 공개 메소드

Reads the lines of a file.
public ReadLines ( string path ) : IEnumerable
path string The file to read.
리턴 IEnumerable

ReadLines() 공개 메소드

Reads the lines of a file that has a specified encoding.
public ReadLines ( string path, Encoding encoding ) : IEnumerable
path string The file to read.
encoding System.Text.Encoding The encoding that is applied to the contents of the file.
리턴 IEnumerable

WriteAllBytes() 공개 메소드

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 WriteAllBytes ( string path, byte bytes ) : void
path string The file to write to.
bytes byte The bytes to write to the file.
리턴 void

WriteAllLines() 공개 메소드

Creates a new file, writes a collection of strings to the file, and then closes the file.
public WriteAllLines ( string path, IEnumerable contents ) : void
path string The file to write to.
contents IEnumerable The lines to write to the file.
리턴 void

WriteAllLines() 공개 메소드

Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.
public WriteAllLines ( string path, IEnumerable contents, Encoding encoding ) : void
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.
리턴 void

WriteAllText() 공개 메소드

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 WriteAllText ( string path, string contents ) : void
path string The file to write to.
contents string The string to write to the file.
리턴 void

WriteAllText() 공개 메소드

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 WriteAllText ( string path, string contents, Encoding encoding ) : void
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.
리턴 void