private void SaveKarty(object sender, RoutedEventArgs e) { string cesta = Properties.Settings.Default.LokaceKaret; foreach (AKarta k in Karty) { string path = cesta + "/" + k.Karta.Id + ".pk"; FileStream f = File.Create(path); f.Close(); Nini.Config.IniConfigSource source = new Nini.Config.IniConfigSource(path); source.AddConfig("Karta"); k.Karta.Save(source.Configs["Karta"]); source.Save(); } }
public string VratInit(string jmeno, Nini.Config.IConfigSource defaultConfigSource) { if (defaultConfigSource == null) { return(VratInit(jmeno)); } string IniPath = AppDomain.CurrentDomain.BaseDirectory; if (!Directory.Exists(IniPath)) { return(null); } string s = Path.Combine(IniPath, jmeno + pripona); if (!File.Exists(s)) { File.Create(s).Close(); Nini.Config.IConfigSource source = new Nini.Config.IniConfigSource(s); source.Merge(defaultConfigSource); source.Save(); } return(s); }