C# Class Indiefreaks.Xna.Storage.SaveDevice

Exibir arquivo Open project: Indiefreaks/igf

Public Properties

Property Type Description
ProcessorAffinity int[]

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.

Initialize ( ) : void

Allows the SaveDevice to initialize itself.

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.

PromptForDevice ( ) : void

Flags the SaveDevice to prompt for a storage device on the next Update.

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.

Update ( GameTime gameTime ) : void

Allows the component to update itself.

Protected Methods

Method Description
GetStorageDevice ( AsyncCallback callback ) : void

Derived classes should implement this method to call the Guide.BeginShowStorageDeviceSelector method with the desired parameters, using the given callback.

PrepareEventArgs ( SaveDeviceEventArgs args ) : void

Prepares the SaveDeviceEventArgs to be used for an event.

Subclasses can override this method to change the default argument values.

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.

ForcePromptCallback ( IAsyncResult result ) : void

A callback for either of the message boxes telling users they have to choose a storage device, either from cancelling the device selector or disconnecting the device.

GetFileOperationState ( ) : FileOperationState

Helper for getting a FileOperationState object.

HandleEventArgResults ( ) : void

Handles reading from the eventArgs to determine what action to take.

OpenContainer ( string containerName ) : StorageContainer

Helper method to open a StorageContainer.

PendingOperationsDecrement ( ) : void

Helper to decrement the pending operation count.

PendingOperationsIncrement ( ) : void

Helper to increment the pending operation count.

ReselectPromptCallback ( IAsyncResult result ) : void

A callback for either of the message boxes asking the user to select a new device, either from cancelling the device seledctor or disconnecting the device.

ReturnFileOperationState ( FileOperationState state ) : void

Helper for returning a FileOperationState to be recycled.

SaveDevice ( ) : System
SetProcessorAffinity ( ) : void

Helper to set processor affinity for a thread.

ShowMessageBox ( PlayerIndex player, string title, string text, IEnumerable buttons, AsyncCallback callback ) : void
StorageDeviceSelectorCallback ( IAsyncResult result ) : void

A callback for the BeginStorageDeviceSelectorPrompt.

VerifyIsReady ( ) : void

Helper that just checks that IsReady is true and throws if it's false.

Method Details

Delete() public method

Deletes a file.
public Delete ( 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 ) : 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 The name of the container in which to check for the file.
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 The name of the container in which to search for files.
return string[]

GetFiles() public method

Gets an array of all files available in a container.
public GetFiles ( string containerName, string pattern ) : string[]
containerName string The name of the container in which to search for files.
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

GetStorageDevice() protected abstract method

Derived classes should implement this method to call the Guide.BeginShowStorageDeviceSelector method with the desired parameters, using the given callback.
protected abstract GetStorageDevice ( AsyncCallback callback ) : void
callback AsyncCallback The callback to pass to Guide.BeginShowStorageDeviceSelector.
return void

Initialize() public method

Allows the SaveDevice to initialize itself.
public Initialize ( ) : void
return void

Load() public method

Loads a file.
public Load ( 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 ) : 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

PrepareEventArgs() protected method

Prepares the SaveDeviceEventArgs to be used for an event.
Subclasses can override this method to change the default argument values.
protected PrepareEventArgs ( SaveDeviceEventArgs args ) : void
args SaveDeviceEventArgs The event arguments to be configured.
return void

PromptForDevice() public method

Flags the SaveDevice to prompt for a storage device on the next Update.
public PromptForDevice ( ) : void
return void

Save() public method

Saves a file.
public Save ( 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 ) : 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

Update() public method

Allows the component to update itself.
public Update ( GameTime gameTime ) : void
gameTime GameTime The current game timestamp.
return void

Property Details

ProcessorAffinity public_oe static_oe property

Defines the hardware thread on which the operations are performed on the Xbox 360.
public static int[] ProcessorAffinity
return int[]