public static GPLocationProvider getMyLocation() { if (myLocation == null) { myLocation = new GPLocationProvider(); bool bSucc = false; string possibleFile = GPFileHelper.getAppDataFile("mylocation.xml"); if (File.Exists(possibleFile)) { try { myLocation.loadXml(possibleFile); bSucc = true; } catch { } } if (bSucc == false) { NumberFormatInfo fmt = new NumberFormatInfo(); GPLocation loc = new GPLocation(); loc.setCity(GPUserDefaults.StringForKey("myloc.city", "Mayapur")); loc.setCountryCode(GPUserDefaults.StringForKey("myloc.country", "IN")); loc.setLatitudeNorthPositive(double.Parse(GPUserDefaults.StringForKey("myloc.lat", "23.423413"), fmt)); loc.setLongitudeEastPositive(double.Parse(GPUserDefaults.StringForKey("myloc.lon", "88.388079"), fmt)); loc.setTimeZoneName(GPUserDefaults.StringForKey("myloc.tzname", "Asia/Calcutta")); myLocation.setDefaultLocation(loc); } } return(myLocation); }
public string getFullPathForFile(string fileName) { string dir = GPFileHelper.getAppDataDirectory(); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } return(Path.Combine(dir, fileName)); }
public void refreshLanguageList() { languages = new List <GPLanguage>(); string[] files = GPFileHelper.EnumerateLanguageFiles(); foreach (string s in files) { GPLanguage nlang = new GPLanguage(); if (nlang.LoadHeader(s)) { languages.Add(nlang); } } }
public static void saveMyLocation() { string possibleFile = GPFileHelper.getAppDataFile("mylocation.xml"); try { if (myLocation != null) { myLocation.saveXml(possibleFile); } } catch { } }
public static string getFileName() { string dir = GPFileHelper.getAppDataDirectory(); return(Path.Combine(dir, "UserDefaults.txt")); }
public static string GetRecentFileName() { return(Path.Combine(GPFileHelper.getAppDataDirectory(), "recentloc.xml")); }