Class ConfigDictionary
Configuration files: this class is a wrapper around a Dictionary.
Inheritance
ConfigDictionary
Assembly: TowseyLibrary.dll
Syntax
[Obsolete]
public class ConfigDictionary
Constructors
|
Improve this Doc
View Source
ConfigDictionary()
Declaration
public ConfigDictionary()
|
Improve this Doc
View Source
ConfigDictionary(FileInfo[])
Declaration
public ConfigDictionary(params FileInfo[] files)
Parameters
Type |
Name |
Description |
FileInfo[] |
files |
The files.
|
Exceptions
|
Improve this Doc
View Source
ConfigDictionary(String[])
Declaration
public ConfigDictionary(params string[] files)
Parameters
Type |
Name |
Description |
String[] |
files |
The files.
|
Exceptions
Properties
|
Improve this Doc
View Source
Source
Declaration
public string Source { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
ContainsKey(String)
Declaration
public bool ContainsKey(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
GetBoolean(String)
Declaration
public bool GetBoolean(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
GetBoolean(String, Dictionary<String, String>)
Declaration
public static bool GetBoolean(string key, Dictionary<string, string> dict)
Parameters
Returns
|
Improve this Doc
View Source
GetDictionary()
Declaration
public Dictionary<string, string> GetDictionary()
Returns
|
Improve this Doc
View Source
GetDouble(String)
Declaration
public double GetDouble(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
GetDouble(String, Dictionary<String, String>)
Declaration
public static double GetDouble(string key, Dictionary<string, string> dict)
Parameters
Returns
|
Improve this Doc
View Source
GetDoubleNullable(String)
Declaration
public double? GetDoubleNullable(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
GetDoubleNullable(String, Dictionary<String, String>)
Declaration
public static double? GetDoubleNullable(string key, Dictionary<string, string> dict)
Parameters
Returns
|
Improve this Doc
View Source
GetInt(String)
Declaration
public int GetInt(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
GetInt(String, Dictionary<String, String>)
Declaration
public static int GetInt(string key, Dictionary<string, string> dict)
Parameters
Returns
|
Improve this Doc
View Source
GetIntNullable(String)
Declaration
public int? GetIntNullable(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
GetIntNullable(String, Dictionary<String, String>)
Declaration
public static int? GetIntNullable(string key, Dictionary<string, string> dict)
Parameters
Returns
|
Improve this Doc
View Source
GetPath(String)
Declaration
public string GetPath(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
GetString(String)
Declaration
public string GetString(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
GetTable()
Declaration
public Dictionary<string, string> GetTable()
Returns
|
Improve this Doc
View Source
ReadKVPFile2Dictionary(String)
THIS ONLY WORKS IF ONLY HAVE KV PAIRS IN CONFIG FILE.
IF HAVE COMMENTS ETC USE.
Dictionary{string,string} dict = FileTools.ReadPropertiesFile(file))
Declaration
public static Dictionary<string, string> ReadKVPFile2Dictionary(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
Returns
|
Improve this Doc
View Source
ReadPropertiesFile(FileInfo)
Declaration
public static Dictionary<string, string> ReadPropertiesFile(FileInfo fileName)
Parameters
Returns
|
Improve this Doc
View Source
ReadPropertiesFile(String)
Declaration
public static Dictionary<string, string> ReadPropertiesFile(string fName)
Parameters
Type |
Name |
Description |
String |
fName |
|
Returns
|
Improve this Doc
View Source
ReadPropertyFromFile(String, String)
Declaration
public static string ReadPropertyFromFile(string fName, string key)
Parameters
Returns
|
Improve this Doc
View Source
ResolvePath(String)
Declaration
public string ResolvePath(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
Returns
|
Improve this Doc
View Source
SetPair(String, String)
adds key-value pairs to a properties table.
Removes existing pair if it has same key.
Declaration
public void SetPair(string key, string value)
Parameters
Type |
Name |
Description |
String |
key |
key to add or replace.
|
String |
value |
Value to use.
|
|
Improve this Doc
View Source
WriteConfgurationFile(Dictionary<String, String>, FileInfo)
Declaration
public static void WriteConfgurationFile(Dictionary<string, string> dict, FileInfo path)
Parameters
Extension Methods