C# Class Globals.RegistryAccess

Mostra file Open project: troymac1ure/Entity Class Usage Examples

Public Methods

Method Description
AddRecentFile ( int pos, string fileName ) : void

Adds a file to the Halo 2 recently used list

CloseReg ( ) : void

Closes the Registry read access.

RegistryAccess ( RegistryKey mainKey, string subKey ) : System

Opens access to reading the registry. Call the CloseReg() function when complete

copyKey ( RegistryKey parentKey, string keyNameToCopy, string newKeyName ) : bool

Copy a registry key. The parentKey must be writeable.

getKeys ( ) : string[]
getNames ( ) : string[]
getValue ( string valueName ) : string

Returns a value from the Label in the current path use setKey() to set the current mainKey & path

getValues ( ) : object[]
removeKey ( RegistryKey mainKey, string subKey ) : bool
removeValue ( RegistryKey mainKey, string subKey, string valueName ) : bool

Used to remove a value from the registry

renameSubKey ( RegistryKey parentKey, string subKeyName, string newSubKeyName ) : bool

Renames a subkey of the passed in registry key since the Framework totally forgot to include such a handy feature.

setKey ( RegistryKey mainKey, string subKey ) : void

Sets the current mainkey & path

setValue ( RegistryKey mainKey, string subKey, string valueName, object value ) : bool

Sets a registry value

Private Methods

Method Description
recurseCopyKey ( RegistryKey sourceKey, RegistryKey destinationKey ) : void

Method Details

AddRecentFile() public static method

Adds a file to the Halo 2 recently used list
public static AddRecentFile ( int pos, string fileName ) : void
pos int The position in which to add the fileName (0-9)
fileName string The location and name of the file
return void

CloseReg() public method

Closes the Registry read access.
public CloseReg ( ) : void
return void

RegistryAccess() public method

Opens access to reading the registry. Call the CloseReg() function when complete
public RegistryAccess ( RegistryKey mainKey, string subKey ) : System
mainKey Microsoft.Win32.RegistryKey Windows.Win32.Registry (Halo 2 uses CurrentUser)
subKey string The path to the Label
return System

copyKey() public static method

Copy a registry key. The parentKey must be writeable.
public static copyKey ( RegistryKey parentKey, string keyNameToCopy, string newKeyName ) : bool
parentKey Microsoft.Win32.RegistryKey
keyNameToCopy string
newKeyName string
return bool

getKeys() public method

public getKeys ( ) : string[]
return string[]

getNames() public method

public getNames ( ) : string[]
return string[]

getValue() public method

Returns a value from the Label in the current path use setKey() to set the current mainKey & path
public getValue ( string valueName ) : string
valueName string The label name to return (Halo 2 uses RegistryAccess.RegNames)
return string

getValues() public method

public getValues ( ) : object[]
return object[]

removeKey() public static method

public static removeKey ( RegistryKey mainKey, string subKey ) : bool
mainKey Microsoft.Win32.RegistryKey
subKey string
return bool

removeValue() public static method

Used to remove a value from the registry
public static removeValue ( RegistryKey mainKey, string subKey, string valueName ) : bool
mainKey Microsoft.Win32.RegistryKey Windows.Win32.Registry (Halo 2 uses CurrentUser)
subKey string The path to the Label
valueName string The Value Label name to remove
return bool

renameSubKey() public static method

Renames a subkey of the passed in registry key since the Framework totally forgot to include such a handy feature.
public static renameSubKey ( RegistryKey parentKey, string subKeyName, string newSubKeyName ) : bool
parentKey Microsoft.Win32.RegistryKey
subKeyName string The name of the subkey that you want to rename ///
newSubKeyName string The new name of the RegistryKey
return bool

setKey() public method

Sets the current mainkey & path
public setKey ( RegistryKey mainKey, string subKey ) : void
mainKey Microsoft.Win32.RegistryKey Windows.Win32.Registry (Halo 2 uses CurrentUser)
subKey string The path to the Label
return void

setValue() public static method

Sets a registry value
public static setValue ( RegistryKey mainKey, string subKey, string valueName, object value ) : bool
mainKey Microsoft.Win32.RegistryKey A Windows.Win32.Registry value (Halo2 uses CurrentUser)
subKey string The path to the value (Halo 2 uses RegistryAccess.RegPaths)
valueName string The Label of the value (Halo 2 uses RegistryAccess.RegNames)
value object The new value
return bool