C# Class Open.Core.Common.IsolatedStorageModelBase

Base class for settings that are persisted to isolated storage on the client.
Inheritance: ModelBase
Datei anzeigen Open project: philcockfield/Open.TestHarness.SL

Private Properties

Property Type Description
GetStore System.IO.IsolatedStorage.IsolatedStorageSettings
GetStoreFile System.IO.IsolatedStorage.IsolatedStorageFile
IncreaseQuotaTo bool
OnCleared void
OnClearing void
OnSaved void
OnSaving void
ProcessAutoSave void
SaveInternal System.IO.IsolatedStorage.IsolatedStorageException

Public Methods

Method Description
Clear ( ) : void

Removes all the model's items from the Store.

This does not clear the entire store, just the items associated with this model.

DelaySave ( ) : void

Starts the delayed Save action.

IncreaseQuotaBy ( double megabytes ) : bool

Attempts to increase the quota by the specified number of megabytes.

IncreaseQuotaTo ( double megabytes ) : bool

Attempts to increase the quota by the specified number of megabytes.

Save ( ) : bool

Saves the settings to disk.

Save ( double autoIncrementQuotaBy ) : bool

Saves the settings to disk.

Protected Methods

Method Description
IsolatedStorageModelBase ( IsolatedStorageType storeType, string id ) : System

Constructor.

OnBeforeClear ( ) : void

Invoked immediately before the Clear operation. Use this to perform pre-clear operations.

This method is not called if a listener to the 'Clearing' event cancelled the operation.

OnBeforeSave ( ) : void

Invoked immediately before the Save operation. Use this to perform pre-save operations.

This method is not called if a listener to the 'Saving' event cancelled the operation.

Private Methods

Method Description
GetStore ( IsolatedStorageType storeType ) : System.IO.IsolatedStorage.IsolatedStorageSettings
GetStoreFile ( IsolatedStorageType storeType ) : IsolatedStorageFile
IncreaseQuotaTo ( long bytes ) : bool
OnCleared ( ) : void
OnClearing ( CancelEventArgs e ) : void
OnSaved ( ) : void
OnSaving ( CancelEventArgs e ) : void
ProcessAutoSave ( ) : void
SaveInternal ( ) : IsolatedStorageException

Method Details

Clear() public method

Removes all the model's items from the Store.
This does not clear the entire store, just the items associated with this model.
public Clear ( ) : void
return void

DelaySave() public method

Starts the delayed Save action.
public DelaySave ( ) : void
return void

IncreaseQuotaBy() public method

Attempts to increase the quota by the specified number of megabytes.
public IncreaseQuotaBy ( double megabytes ) : bool
megabytes double
return bool

IncreaseQuotaTo() public method

Attempts to increase the quota by the specified number of megabytes.
public IncreaseQuotaTo ( double megabytes ) : bool
megabytes double
return bool

IsolatedStorageModelBase() protected method

Constructor.
protected IsolatedStorageModelBase ( IsolatedStorageType storeType, string id ) : System
storeType IsolatedStorageType The type of persistence store.
id string The unique identifier of the settings (used as a prefix).
return System

OnBeforeClear() protected method

Invoked immediately before the Clear operation. Use this to perform pre-clear operations.
This method is not called if a listener to the 'Clearing' event cancelled the operation.
protected OnBeforeClear ( ) : void
return void

OnBeforeSave() protected method

Invoked immediately before the Save operation. Use this to perform pre-save operations.
This method is not called if a listener to the 'Saving' event cancelled the operation.
protected OnBeforeSave ( ) : void
return void

Save() public method

Saves the settings to disk.
public Save ( ) : bool
return bool

Save() public method

Saves the settings to disk.
/// Is thrown if (after increasing the quota) the file could still not be saved. /// Make sure when saving that a suitable quota increase amount is specified. ///
public Save ( double autoIncrementQuotaBy ) : bool
autoIncrementQuotaBy double The value to attempt to auto increment the quota by if there is not enough space to save.
return bool