C# Class Indiefreaks.Xna.Storage.SaveDevice

Afficher le fichier Open project: Indiefreaks/igf

Méthodes publiques

Свойство Type Description
ProcessorAffinity int[]

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode 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 méthode

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.
Résultat void

DeleteAsync() public méthode

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.
Résultat void

DeleteAsync() public méthode

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.
Résultat void

FileExists() public méthode

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.
Résultat bool

FileExistsAsync() public méthode

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.
Résultat void

FileExistsAsync() public méthode

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.
Résultat void

GetFiles() public méthode

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.
Résultat string[]

GetFiles() public méthode

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.
Résultat string[]

GetFilesAsync() public méthode

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.
Résultat void

GetFilesAsync() public méthode

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.
Résultat void

GetFilesAsync() public méthode

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.
Résultat void

GetFilesAsync() public méthode

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.
Résultat void

GetStorageDevice() protected abstract méthode

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.
Résultat void

Initialize() public méthode

Allows the SaveDevice to initialize itself.
public Initialize ( ) : void
Résultat void

Load() public méthode

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.
Résultat void

LoadAsync() public méthode

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.
Résultat void

LoadAsync() public méthode

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.
Résultat void

PrepareEventArgs() protected méthode

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.
Résultat void

PromptForDevice() public méthode

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

Save() public méthode

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.
Résultat void

SaveAsync() public méthode

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.
Résultat void

SaveAsync() public méthode

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.
Résultat void

Update() public méthode

Allows the component to update itself.
public Update ( GameTime gameTime ) : void
gameTime GameTime The current game timestamp.
Résultat 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
Résultat int[]