C# Class SIL.FieldWorks.Common.Controls.Persistence

Inheritance: System.ComponentModel.Component, ISupportInitialize, IFWDisposable
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Свойство Type Description
OnLoadSettings void
OnMoveResize void
OnSaveSettings void
SaveWindowState void

Méthodes publiques

Méthode Description
BeginInit ( ) : void

Required to implement ISupportInitialize.

CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

DeserializeFromBinary ( Stream stream ) : Object

Deserializes an object from binary.

EndInit ( ) : void

When all properties have been initialized, this will be called. This is where we can load the window state.

LoadWindowPosition ( ) : void

Load the top, left, width, and height of the window from the registry, use default application parameters if not present in registry. This should be called from OnLayout; it takes effect in the first call AFTER EndInit.

Persistence ( ) : System

Initializes a new instance of the Persistence class

Persistence ( Control parent, Settings loadFunct, Settings saveFunct ) : System

Initializes a new instance of the Persistence class

Persistence ( System container ) : System

Initializes a new instance of the Persistence class

Persistence ( System container, Control parent ) : System

Initializes a new instance of the Persistence class

SaveSettingsNow ( Control ctrl ) : void

Initiate saving all the settings for the specified control, and for all of the control's owned controls which implement ISettings.

Note: A parent's ISettings::SaveSettingsNow should call this method (Persistence::SaveSettingsNow).

SaveWindowPosition ( RegistryKey key ) : void

Save the top, left, width, and height of the window to the registry.

SerializeToBinary ( object obj ) : MemoryStream

Serializes to binary an object.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Releases the resources used by Persistence

Private Methods

Méthode Description
OnLoadSettings ( object obj, System e ) : void

Tasks needing to be done when Window is being created: Load window position. Load settings.

OnMoveResize ( object sender, System e ) : void
OnSaveSettings ( object obj, System e ) : void

Tasks needing to be done when Window is being closed: Save window position. Save window state. Save settings.

SaveWindowState ( RegistryKey key ) : void

Method Details

BeginInit() public méthode

Required to implement ISupportInitialize.
public BeginInit ( ) : void
Résultat void

CheckDisposed() public méthode

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
Résultat void

DeserializeFromBinary() public static méthode

Deserializes an object from binary.
public static DeserializeFromBinary ( Stream stream ) : Object
stream Stream The stream from which to deserialize
Résultat Object

Dispose() protected méthode

Releases the resources used by Persistence
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

EndInit() public méthode

When all properties have been initialized, this will be called. This is where we can load the window state.
public EndInit ( ) : void
Résultat void

LoadWindowPosition() public méthode

Load the top, left, width, and height of the window from the registry, use default application parameters if not present in registry. This should be called from OnLayout; it takes effect in the first call AFTER EndInit.
public LoadWindowPosition ( ) : void
Résultat void

Persistence() public méthode

Initializes a new instance of the Persistence class
public Persistence ( ) : System
Résultat System

Persistence() public méthode

Initializes a new instance of the Persistence class
public Persistence ( Control parent, Settings loadFunct, Settings saveFunct ) : System
parent System.Windows.Forms.Control
loadFunct Settings
saveFunct Settings
Résultat System

Persistence() public méthode

Initializes a new instance of the Persistence class
public Persistence ( System container ) : System
container System
Résultat System

Persistence() public méthode

Initializes a new instance of the Persistence class
public Persistence ( System container, Control parent ) : System
container System
parent System.Windows.Forms.Control
Résultat System

SaveSettingsNow() public méthode

Initiate saving all the settings for the specified control, and for all of the control's owned controls which implement ISettings.
Note: A parent's ISettings::SaveSettingsNow should call this method (Persistence::SaveSettingsNow).
public SaveSettingsNow ( Control ctrl ) : void
ctrl System.Windows.Forms.Control Control or form whose settings should be saved.
Résultat void

SaveWindowPosition() public méthode

Save the top, left, width, and height of the window to the registry.
public SaveWindowPosition ( RegistryKey key ) : void
key Microsoft.Win32.RegistryKey The Registry Key.
Résultat void

SerializeToBinary() public static méthode

Serializes to binary an object.
public static SerializeToBinary ( object obj ) : MemoryStream
obj object The object to be serialized.
Résultat System.IO.MemoryStream