C# Class Stumps.RuleSettingsHelper

A class that provides a friendly interface for managing the settings of a T:Stumps.IStumpRule object.
Show file Open project: Cayan-LLC/stumps Class Usage Examples

Public Methods

Method Description
Add ( string settingName, bool value ) : void

Adds a specified boolean to the settings list.

Add ( string settingName, byte value ) : void

Adds a specified byte array to the settings list.

Add ( string settingName, int value ) : void

Adds a specified integer to the settings list.

Add ( string settingName, string value ) : void

Adds a specified string to the settings list.

FindBoolean ( string settingName, bool defaultValue ) : bool

Finds the T:System.Boolean value for the specified setting.

FindByteArray ( string settingName, byte defaultValue ) : byte[]

Finds the array of T:System.Byte values for the specified setting.

FindString ( string settingName, string defaultValue ) : string

Finds the T:System.String value for the specified setting.

RuleSettingsHelper ( ) : System

Initializes a new instance of the T:Stumps.RuleSettingsHelper class.

RuleSettingsHelper ( IEnumerable settings ) : System

Initializes a new instance of the T:Stumps.RuleSettingsHelper class.

ToEnumerableList ( ) : IEnumerable

Gets an enumearable list of the T:Stumps.RuleSetting objects.

Private Methods

Method Description
AddOrUpdateSetting ( string settingName, string value ) : void

Adds or udpates the value of a setting.

FindInteger ( string settingName, int defaultValue ) : int
FindSettingValue ( string settingName ) : string

Finds a specified value from the dictionary.

A null value is returned if the setting is not found.

Method Details

Add() public method

Adds a specified boolean to the settings list.
is null.
public Add ( string settingName, bool value ) : void
settingName string The name of the setting.
value bool The value of the setting.
return void

Add() public method

Adds a specified byte array to the settings list.
is null. /// -or- /// is null. cannot have a length of '0'.
public Add ( string settingName, byte value ) : void
settingName string The name of the setting.
value byte The value of the setting.
return void

Add() public method

Adds a specified integer to the settings list.
is null.
public Add ( string settingName, int value ) : void
settingName string The name of the setting.
value int The value of the setting.
return void

Add() public method

Adds a specified string to the settings list.
/// is null. /// -or- /// is null. ///
public Add ( string settingName, string value ) : void
settingName string The name of the setting.
value string The value of the setting.
return void

FindBoolean() public method

Finds the T:System.Boolean value for the specified setting.
public FindBoolean ( string settingName, bool defaultValue ) : bool
settingName string The name of the setting.
defaultValue bool The default value of the setting if it is not found.
return bool

FindByteArray() public method

Finds the array of T:System.Byte values for the specified setting.
public FindByteArray ( string settingName, byte defaultValue ) : byte[]
settingName string The name of the setting.
defaultValue byte The default value of the setting if it is not found.
return byte[]

FindString() public method

Finds the T:System.String value for the specified setting.
public FindString ( string settingName, string defaultValue ) : string
settingName string The name of the setting.
defaultValue string The default value of the setting if it is not found.
return string

RuleSettingsHelper() public method

Initializes a new instance of the T:Stumps.RuleSettingsHelper class.
public RuleSettingsHelper ( ) : System
return System

RuleSettingsHelper() public method

Initializes a new instance of the T:Stumps.RuleSettingsHelper class.
public RuleSettingsHelper ( IEnumerable settings ) : System
settings IEnumerable An enumerable collection of objects.
return System

ToEnumerableList() public method

Gets an enumearable list of the T:Stumps.RuleSetting objects.
public ToEnumerableList ( ) : IEnumerable
return IEnumerable