public static void LoadConfig()
 {
     Config = new IniFile(ConfigPath);
     Config.Load();
 }
Пример #2
0
 /// <summary>
 /// Merges the other *.ini file into this one by overwriting existing values. Comments get appended.
 /// </summary>
 /// <param name="f"></param>
 public void Merge(IniFile f)
 {
     this.data.Merge(f.data);
 }
 public void Set(IniFile f, String section, String key, bool value)
 {
     Set(f, section, key, value ? "1" : "0");
 }
        /*
         *********************************************************************************************************************************************
         * Other stuff
         ********************************************************************************************************************************************
         */

        public void Merge(IniFile f, IniData d)
        {
            this.GetIniData(f).Merge(d);
        }
 public int GetInt(IniFile f, String section, String key, int defaultValue)
 {
     return(Utils.ToInt(GetString(f, section, key, defaultValue.ToString(enUS))));
 }
 public void Set(IniFile f, String section, String key, uint value)
 {
     Set(f, section, key, Utils.ToString(value));
 }
 public float GetFloat(IniFile f, String section, String key, float defaultValue)
 {
     return(Utils.ToFloat(GetString(f, section, key, defaultValue.ToString(enUS))));
 }
 public int GetInt(IniFile f, String section, String key)
 {
     return(Utils.ToInt(GetString(f, section, key)));
 }
 public float GetFloat(IniFile f, String section, String key)
 {
     return(Utils.ToFloat(GetString(f, section, key)));
 }
 public bool GetBool(IniFile f, String section, String key, bool defaultValue)
 {
     return(GetString(f, section, key, defaultValue ? "1" : "0") == "1");
 }
 public bool GetBool(IniFile f, String section, String key)
 {
     return(GetString(f, section, key) == "1");
 }
        public String GetString(IniFile f, String section, String key, String defaultValue)
        {
            String value = GetIniData(f)[section][key];

            return(value != null ? value : defaultValue);
        }
 public bool Exists(IniFile f, String section, String key)
 {
     return(GetIniData(f)[section][key] != null);
 }