public bool GetKeyValueBool(string sSection, string sKey, bool bDefault) { if (DOM.ContainsKey(sSection)) { if (DOM[sSection].ContainsKey(sKey)) { if (DOM[sSection][sKey] != "FALSE" || DOM[sSection][sKey] != "false") { return(true); } else { return(bDefault); } } else { return(bDefault); } } else { return(bDefault); } }
public int GetKeyValueInt(string sSection, string sKey, int iDefault) { int value; if (DOM.ContainsKey(sSection)) { if (DOM[sSection].ContainsKey(sKey)) { if (Int32.TryParse(DOM[sSection][sKey], out value)) { return(value); } else { return(iDefault); } } else { return(iDefault); } } else { return(iDefault); } }
public string GetKeyValueStr(string sSection, string sKey, string sDefault) { if (DOM.ContainsKey(sSection)) { if (DOM[sSection].ContainsKey(sKey)) { return((string)DOM[sSection][sKey]); } else { return(sDefault); } } else { return(sDefault); } }
public bool SetKeyValue(string sSection, string sKey, string sValue) { if (!DOM.ContainsKey(sSection)) { DOM.Add(sSection, new Dictionary <string, string>()); DOM[sSection].Add(sKey, sValue); return(true); } else { if (!DOM[sSection].ContainsKey(sKey)) { DOM[sSection].Add(sKey, sValue); return(true); } else { return(false); } } }