C# Class NppSharp.Settings

Manages settings stored in the registry.
显示文件 Open project: cmrazek/NppSharp

Public Methods

Method Description
GetBool ( string keyPath, bool defaultValue ) : bool

Gets a boolean value from the registry.

GetBoolOrNull ( string keyPath, bool defaultValue ) : bool?

Gets an bool? value from the registry.

GetInt ( string keyPath, int defaultValue ) : int

Gets an integer value from the registry.

GetIntOrNull ( string keyPath, int defaultValue ) : int?

Gets an int? value from the registry.

GetString ( string keyPath, string defaultValue ) : string

Gets a string value from the registry.

GetStringList ( string keyPath ) : List

Gets a string list value from the registry.

MakeOwsKeyPath ( OutputStyle style, string name ) : string

Creates a key-path for an output window style. The value will be placed under a sub-key for the style number.

SetBool ( string keyPath, bool value ) : void

Inserts a boolean value into the registry.

SetBoolOrNull ( string keyPath, bool value ) : void

Inserts a bool? value into the registry. If 'value' is null, then the registry value will be deleted if it exists.

SetInt ( string keyPath, int value ) : void

Inserts an integer value into the registry.

SetIntOrNull ( string keyPath, int value ) : void

Inserts an integer value into the registry. If 'value' is null, then the registry value will be deleted if it exists.

SetString ( string keyPath, string value ) : void

Inserts a string value into the registry.

SetStringList ( string keyPath, IEnumerable list ) : void

Inserts a string list value into the registry.

Private Methods

Method Description
SplitKey ( string keyPath, string &keyOut, string &nameOut ) : void

Splits a key out into the sub-key and value portions.

Method Details

GetBool() public static method

Gets a boolean value from the registry.
public static GetBool ( string keyPath, bool defaultValue ) : bool
keyPath string The key-path for the value.
defaultValue bool If the value does not exist, this will be returned instead.
return bool

GetBoolOrNull() public static method

Gets an bool? value from the registry.
public static GetBoolOrNull ( string keyPath, bool defaultValue ) : bool?
keyPath string The key-path for the value.
defaultValue bool If the value does not exist, this will be returned instead.
return bool?

GetInt() public static method

Gets an integer value from the registry.
public static GetInt ( string keyPath, int defaultValue ) : int
keyPath string The key-path for the value.
defaultValue int If the value does not exist, this will be returned instead.
return int

GetIntOrNull() public static method

Gets an int? value from the registry.
public static GetIntOrNull ( string keyPath, int defaultValue ) : int?
keyPath string The key-path for the value.
defaultValue int If the value does not exist, this will be returned instead.
return int?

GetString() public static method

Gets a string value from the registry.
public static GetString ( string keyPath, string defaultValue ) : string
keyPath string The key-path for the value.
defaultValue string If the value does not exist, this will be returned instead.
return string

GetStringList() public static method

Gets a string list value from the registry.
public static GetStringList ( string keyPath ) : List
keyPath string The key-path for the value.
return List

MakeOwsKeyPath() public static method

Creates a key-path for an output window style. The value will be placed under a sub-key for the style number.
public static MakeOwsKeyPath ( OutputStyle style, string name ) : string
style OutputStyle The style number.
name string The value name.
return string

SetBool() public static method

Inserts a boolean value into the registry.
public static SetBool ( string keyPath, bool value ) : void
keyPath string The key-path for the value.
value bool The value to be inserted.
return void

SetBoolOrNull() public static method

Inserts a bool? value into the registry. If 'value' is null, then the registry value will be deleted if it exists.
public static SetBoolOrNull ( string keyPath, bool value ) : void
keyPath string The key-path for the value.
value bool The value to be inserted.
return void

SetInt() public static method

Inserts an integer value into the registry.
public static SetInt ( string keyPath, int value ) : void
keyPath string The key-path for the value.
value int The value to be inserted.
return void

SetIntOrNull() public static method

Inserts an integer value into the registry. If 'value' is null, then the registry value will be deleted if it exists.
public static SetIntOrNull ( string keyPath, int value ) : void
keyPath string The key-path for the value.
value int The value to be inserted.
return void

SetString() public static method

Inserts a string value into the registry.
public static SetString ( string keyPath, string value ) : void
keyPath string The key-path for the value.
value string The value to be inserted.
return void

SetStringList() public static method

Inserts a string list value into the registry.
public static SetStringList ( string keyPath, IEnumerable list ) : void
keyPath string The key-path for the value.
list IEnumerable The string list to be inserted. /// Will actually be saved as an XML string containing the list.
return void