C# Class DSShared.Windows.RegistryInfo

a class to help facilitate the saving and loading of values into the registry in a central location
Mostrar archivo Open project: pmprog/OpenXCOM.Tools Class Usage Examples

Public Methods

Method Description
AddProperty ( ) : void

Adds properties to be saved/loaded

AddProperty ( PropertyInfo property ) : void

adds a property to be saved/loaded

ClearKey ( ) : void

Calls ClearKey(false)

ClearKey ( bool saveOnClose ) : void

Deletes the key located at HKEY_CURRENT_USER\Software\RegKey\ RegKey is the public static parameter of this class

CloseKey ( ) : void

Closes the registry key previously opened by OpenKey()

Closing ( object sender, System e ) : void

Method intended for use with Form.Closing events - directly calls Save

Load ( object sender, EventArgs e ) : void

loads the specified values from the registry. parameters match those needed for a Form.Load event

OpenKey ( ) : RegistryKey

Opens the registry key and returns it for custom read/write

RegistryInfo ( object obj ) : System

Constructor that uses the ToString() value of the object as the name of the constructor parameter

RegistryInfo ( object obj, string name ) : System

Constructor that uses the name parameter as the registry key to save values under

Save ( object sender, EventArgs e ) : void

Saves the specified values into the registry

Method Details

AddProperty() public method

Adds properties to be saved/loaded
public AddProperty ( ) : void
return void

AddProperty() public method

adds a property to be saved/loaded
public AddProperty ( PropertyInfo property ) : void
property System.Reflection.PropertyInfo
return void

ClearKey() public method

Calls ClearKey(false)
public ClearKey ( ) : void
return void

ClearKey() public method

Deletes the key located at HKEY_CURRENT_USER\Software\RegKey\ RegKey is the public static parameter of this class
public ClearKey ( bool saveOnClose ) : void
saveOnClose bool if false, a future call to Save() will have no effect
return void

CloseKey() public method

Closes the registry key previously opened by OpenKey()
public CloseKey ( ) : void
return void

Closing() public method

Method intended for use with Form.Closing events - directly calls Save
public Closing ( object sender, System e ) : void
sender object
e System
return void

Load() public method

loads the specified values from the registry. parameters match those needed for a Form.Load event
public Load ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

OpenKey() public method

Opens the registry key and returns it for custom read/write
public OpenKey ( ) : RegistryKey
return Microsoft.Win32.RegistryKey

RegistryInfo() public method

Constructor that uses the ToString() value of the object as the name of the constructor parameter
public RegistryInfo ( object obj ) : System
obj object
return System

RegistryInfo() public method

Constructor that uses the name parameter as the registry key to save values under
public RegistryInfo ( object obj, string name ) : System
obj object the object to save/load values into the registry
name string the name of the registry key to save/load
return System

Save() public method

Saves the specified values into the registry
public Save ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void