Example #1
0
 /// <summary>
 /// Uloží Hodnoty
 /// </summary>
 public static void Save()
 {
     if (Hodnoty == null)
     {
         return;
     }
     Nini.Config.IConfigSource source = Ini.InitSoubor();
     source.Configs.Clear();
     foreach (Hodnota h in Hodnoty)
     {
         if (h != null)
         {
             Nini.Config.IConfig config = source.Configs[h.Sekce];
             if (config == null)
             {
                 config = source.AddConfig(h.Sekce);
             }
             if (config != null)
             {
                 config.Set(h.Jmeno, h.Value);
             }
         }
     }
     source.Save();
 }
Example #2
0
 /// <summary>
 /// Nacte hodnoty ze souboru
 /// </summary>
 public static void Load()
 {
     if (Hodnoty == null)
     {
         return;
     }
     //nacte hodnoty
     Nini.Config.IConfigSource source = Ini.InitSoubor();
     foreach (Hodnota h in Hodnoty)
     {
         Nini.Config.IConfig config = source.Configs[h.Sekce];
         if (config == null)
         {
             config = source.AddConfig(h.Sekce);
         }
         if (config != null)
         {
             if (config.Contains(h.Jmeno))
             {
                 h.Refresh(config);
             }
             else
             {
                 config.Set(h.Jmeno, h.Value);
             }
         }
     }
 }
Example #3
0
        public void Save(Nini.Config.IConfigSource source)
        {
            Nini.Config.IConfig config = source.AddConfig("Druhy");
            string s = "";

            foreach (string ss in druhy)
            {
                if (s == "")
                {
                    s = ss;
                }
                else
                {
                    s = s + "," + ss;
                }
            }
            config.Set("Všechny druhy", s);
        }