C# Class MapView.Settings

A wrapper around a Hashtable for Setting objects. Setting objects are intended to use with the CustomPropertyGrid
Exibir arquivo Open project: pmprog/OpenXCOM.Tools Class Usage Examples

Public Methods

Method Description
AddConverter ( Type t, ConvertObject o ) : void
AddSetting ( string name, object val, string desc, string category, ValueChangedDelegate eh, bool reflect, object refObj ) : void

adds a setting to this settings object

GetSetting ( string key, object defaultvalue ) : Setting

Gets the Setting object tied to the string. If there is no Setting object, one will be created with the defaultValue

ReadSettings ( VarCollection vc, KeyVal kv, Settings currSettings ) : void
Save ( string name, System sw ) : void
Settings ( ) : System
this ( string key ) : Setting

Get/Set the Setting object tied to the input string

Private Methods

Method Description
convert ( object o ) : string
convertColor ( object o ) : string
reflectEvent ( object sender, string key, object val ) : void

Method Details

AddConverter() public static method

public static AddConverter ( Type t, ConvertObject o ) : void
t System.Type
o ConvertObject
return void

AddSetting() public method

adds a setting to this settings object
public AddSetting ( string name, object val, string desc, string category, ValueChangedDelegate eh, bool reflect, object refObj ) : void
name string property name
val object start value of the property
desc string property description
category string property category
eh ValueChangedDelegate event handler to recieve the PropertyValueChanged event
reflect bool if true, an internal event handler will be created - the refObj must not be null and the name must be the name of a property of the type that refObj is
refObj object the object that will recieve the changed property values
return void

GetSetting() public method

Gets the Setting object tied to the string. If there is no Setting object, one will be created with the defaultValue
public GetSetting ( string key, object defaultvalue ) : Setting
key string The name of the setting object
defaultvalue object if there is no Setting object tied to the string, a Setting will be created with this as its Value
return Setting

ReadSettings() public static method

public static ReadSettings ( VarCollection vc, KeyVal kv, Settings currSettings ) : void
vc XCom.VarCollection
kv XCom.KeyVal
currSettings Settings
return void

Save() public method

public Save ( string name, System sw ) : void
name string
sw System
return void

Settings() public method

public Settings ( ) : System
return System

this() public method

Get/Set the Setting object tied to the input string
public this ( string key ) : Setting
key string
return Setting