public static void SaveInstanceData() { SaveApplicationSettings(ApplicationSettingsFilePath); if (TLocationDatabase.Modified) { TLocationDatabase.SaveFile(LocationsFilePath); } if (TCountry.IsModified()) { TCountry.SaveFile(CountriesFilePath); } if (GCStrings.gstr_Modified) { GCStrings.SaveStringsFile(StringsFilePath); } GCDisplaySettings.SaveDisplaySettingsFile(DisplaySettingsFilePath); GCFestivalBookCollection.SaveAllChangedFestivalBooks(ConfigurationFolderPath); if (TTimeZone.Modified) { TTimeZone.SaveFile(TimezonesFilePath); } }
public static TCountry GetCurrentCountry() { CultureInfo ci = CultureInfo.CurrentCulture; RegionInfo ri = new RegionInfo(ci.LCID); TCountry tc = FindCountryByISOCode(ri.TwoLetterISORegionName); if (tc == null) { return(FindCountryByISOCode("ID")); } else { return(tc); } }
public static void LoadInstanceData() { System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; // initialization for AppDir initFolders(); // initialization of global strings GCStrings.LoadStringsFile(StringsFilePath); // inicializacia timezones TTimeZone.LoadFile(TimezonesFilePath); // inicializacia countries TCountry.LoadFile(CountriesFilePath); // inicializacia miest a kontinentov // lazy loading of data TLocationDatabase.FileName = LocationsFilePath; //CLocationList.OpenFile(); // inicializacia zobrazovanych nastaveni GCDisplaySettings.LoadDisplaySettingsFile(DisplaySettingsFilePath); // inicializacia custom events GCFestivalBookCollection.OpenFile(ConfigurationFolderPath); // looking for files *.recn GCConfigRatedManager.RefreshListFromDirectory(ConfigurationFolderPath); // initialization of global variables myLocation.EncodedString = GCLocation.DefaultEncodedString; recentLocations.Add(new GCLocation(myLocation)); LoadApplicationSettings(ApplicationSettingsFilePath); // refresh fasting style after loading user settings //GCFestivalBook.SetOldStyleFasting(GCDisplaySettings.Current.getValue(42)); // inicializacia tipov dna if (!File.Exists(TipsFilePath)) { File.WriteAllText(TipsFilePath, Properties.Resources.tips); } }
/// <summary> /// Loading countries from permanent storage /// </summary> /// <param name="strFile"></param> /// <returns></returns> public static int LoadFile(string strFile) { if (!File.Exists(strFile)) { File.WriteAllText(strFile, Properties.Resources.countries2016); } XmlDocument doc = new XmlDocument(); doc.Load(strFile); foreach (XmlElement ec in doc.GetElementsByTagName("Country")) { TCountry tc = new TCountry(); tc.LoadFromNode(ec); Countries.Add(tc); } return(Countries.Count()); }