C# Class Indiefreaks.Xna.Storage.IsolatedStorageSaveDevice

An implementation of ISaveDevice utilizing IsolatedStorage for Windows Phone. Given that this is an ISaveDevice, all of our methods still have a container name for compatibility, but that parameter is simply ignored by the implementation since there is no concept of a container within IsolatedStorage.
Inheritance: IAsyncSaveDevice
Datei anzeigen Open project: Indiefreaks/igf Class Usage Examples

Public Methods

Method Description
Delete ( string containerName, string fileName ) : void

Deletes a file.

DeleteAsync ( string containerName, string fileName ) : void

Deletes a file asynchronously.

DeleteAsync ( string containerName, string fileName, object userState ) : void

Deletes a file asynchronously.

FileExists ( string containerName, string fileName ) : bool

Determines if a given file exists.

FileExistsAsync ( string containerName, string fileName ) : void

Determines if a given file exists asynchronously.

FileExistsAsync ( string containerName, string fileName, object userState ) : void

Determines if a given file exists asynchronously.

GetFiles ( string containerName ) : string[]

Gets an array of all files available in a container.

GetFiles ( string containerName, string pattern ) : string[]

Gets an array of all files available in a container.

GetFilesAsync ( string containerName ) : void

Gets an array of all files available in a container asynchronously.

GetFilesAsync ( string containerName, object userState ) : void

Gets an array of all files available in a container asynchronously.

GetFilesAsync ( string containerName, string pattern ) : void

Gets an array of all files available in a container that match the given pattern asynchronously.

GetFilesAsync ( string containerName, string pattern, object userState ) : void

Gets an array of all files available in a container that match the given pattern asynchronously.

Load ( string containerName, string fileName, FileAction loadAction ) : void

Loads a file.

LoadAsync ( string containerName, string fileName, FileAction loadAction ) : void

Loads a file asynchronously.

LoadAsync ( string containerName, string fileName, FileAction loadAction, object userState ) : void

Loads a file asynchronously.

Save ( string containerName, string fileName, FileAction saveAction ) : void

Saves a file.

SaveAsync ( string containerName, string fileName, FileAction saveAction ) : void

Saves a file asynchronously.

SaveAsync ( string containerName, string fileName, FileAction saveAction, object userState ) : void

Saves a file asynchronously.

Private Methods

Method Description
DoDeleteAsync ( object asyncState ) : void

Helper that performs our asynchronous deleting.

DoFileExistsAsync ( object asyncState ) : void

Helper that performs our asynchronous FileExists.

DoGetFilesAsync ( object asyncState ) : void

Helper that performs our asynchronous GetFiles.

DoLoadAsync ( object asyncState ) : void

Helper that performs our asynchronous loading.

DoSaveAsync ( object asyncState ) : void

Helper that performs our asynchronous saving.

GetFileOperationState ( ) : FileOperationState

Helper for getting a FileOperationState object.

GetIsolatedStorage ( ) : IsolatedStorageFile

Helper method that gets isolated storage. On Windows we use GetUserStoreForDomain, but on the other platforms we use GetUserStoreForApplication.

PendingOperationsDecrement ( ) : void

Helper to decrement the pending operation count.

PendingOperationsIncrement ( ) : void

Helper to increment the pending operation count.

ReturnFileOperationState ( FileOperationState state ) : void

Helper for returning a FileOperationState to be recycled.

Method Details

Delete() public method

Deletes a file.
public Delete ( string containerName, string fileName ) : void
containerName string Used to match the ISaveDevice interface; ignored by the implementation.
fileName string The file to delete.
return void

DeleteAsync() public method

Deletes a file asynchronously.
public DeleteAsync ( string containerName, string fileName ) : void
containerName string The name of the container from which to delete the file.
fileName string The file to delete.
return void

DeleteAsync() public method

Deletes a file asynchronously.
public DeleteAsync ( string containerName, string fileName, object userState ) : void
containerName string The name of the container from which to delete the file.
fileName string The file to delete.
userState object A state object used to identify the async operation.
return void

FileExists() public method

Determines if a given file exists.
public FileExists ( string containerName, string fileName ) : bool
containerName string Used to match the ISaveDevice interface; ignored by the implementation.
fileName string The name of the file.
return bool

FileExistsAsync() public method

Determines if a given file exists asynchronously.
public FileExistsAsync ( string containerName, string fileName ) : void
containerName string The name of the container in which to check for the file.
fileName string The name of the file.
return void

FileExistsAsync() public method

Determines if a given file exists asynchronously.
public FileExistsAsync ( string containerName, string fileName, object userState ) : void
containerName string The name of the container in which to check for the file.
fileName string The name of the file.
userState object A state object used to identify the async operation.
return void

GetFiles() public method

Gets an array of all files available in a container.
public GetFiles ( string containerName ) : string[]
containerName string Used to match the ISaveDevice interface; ignored by the implementation.
return string[]

GetFiles() public method

Gets an array of all files available in a container.
public GetFiles ( string containerName, string pattern ) : string[]
containerName string Used to match the ISaveDevice interface; ignored by the implementation.
pattern string A search pattern to use to find files.
return string[]

GetFilesAsync() public method

Gets an array of all files available in a container asynchronously.
public GetFilesAsync ( string containerName ) : void
containerName string The name of the container in which to search for files.
return void

GetFilesAsync() public method

Gets an array of all files available in a container asynchronously.
public GetFilesAsync ( string containerName, object userState ) : void
containerName string The name of the container in which to search for files.
userState object A state object used to identify the async operation.
return void

GetFilesAsync() public method

Gets an array of all files available in a container that match the given pattern asynchronously.
public GetFilesAsync ( string containerName, string pattern ) : void
containerName string The name of the container in which to search for files.
pattern string A search pattern to use to find files.
return void

GetFilesAsync() public method

Gets an array of all files available in a container that match the given pattern asynchronously.
public GetFilesAsync ( string containerName, string pattern, object userState ) : void
containerName string The name of the container in which to search for files.
pattern string A search pattern to use to find files.
userState object A state object used to identify the async operation.
return void

Load() public method

Loads a file.
public Load ( string containerName, string fileName, FileAction loadAction ) : void
containerName string Used to match the ISaveDevice interface; ignored by the implementation.
fileName string The file to load.
loadAction FileAction The load action to perform.
return void

LoadAsync() public method

Loads a file asynchronously.
public LoadAsync ( string containerName, string fileName, FileAction loadAction ) : void
containerName string The name of the container from which to load the file.
fileName string The file to load.
loadAction FileAction The load action to perform.
return void

LoadAsync() public method

Loads a file asynchronously.
public LoadAsync ( string containerName, string fileName, FileAction loadAction, object userState ) : void
containerName string The name of the container from which to load the file.
fileName string The file to load.
loadAction FileAction The load action to perform.
userState object A state object used to identify the async operation.
return void

Save() public method

Saves a file.
public Save ( string containerName, string fileName, FileAction saveAction ) : void
containerName string Used to match the ISaveDevice interface; ignored by the implementation.
fileName string The file to save.
saveAction FileAction The save action to perform.
return void

SaveAsync() public method

Saves a file asynchronously.
public SaveAsync ( string containerName, string fileName, FileAction saveAction ) : void
containerName string The name of the container in which to save the file.
fileName string The file to save.
saveAction FileAction The save action to perform.
return void

SaveAsync() public method

Saves a file asynchronously.
public SaveAsync ( string containerName, string fileName, FileAction saveAction, object userState ) : void
containerName string The name of the container in which to save the file.
fileName string The file to save.
saveAction FileAction The save action to perform.
userState object A state object used to identify the async operation.
return void