Exemple #1
0
        public static void Report(GPLocationProvider loc, string prefix)
        {
            GPGregorianTime start = new GPGregorianTime(loc);
            GPGregorianTime end   = new GPGregorianTime(loc);

            start.setDate(2010, 1, 1);
            end.setDate(2015, 1, 1);

            GPCalendarResults calendar = new GPCalendarResults();

            calendar.CalculateCalendar(start, Convert.ToInt32(end.getJulianLocalNoon() - start.getJulianLocalNoon()));

            GPCoreEventResults coreEvents = new GPCoreEventResults();

            coreEvents.Sort(false);
            coreEvents.CalculateEvents(loc, start, end);

            string path = "d:\\gcal\\reports\\";

            if (Directory.Exists(path))
            {
                File.WriteAllText(Path.Combine(path, prefix + "-cal-" + loc.getCity() + ".txt"),
                                  FormaterInternal.getInternalDalendarData(calendar));
                File.WriteAllText(Path.Combine(path, prefix + "-eve-" + loc.getCity() + ".txt"),
                                  FormaterInternal.getInternalEventsText(coreEvents));
            }
        }
Exemple #2
0
        public static void setMyLocation(GPLocationProvider value)
        {
            if (value != null)
            {
                myLocation = value;

                GPUserDefaults.SetStringForKey("myloc.city", value.getCity());
                GPUserDefaults.SetStringForKey("myloc.country", value.getLocation(0).getCountryCode());
                GPUserDefaults.SetStringForKey("myloc.lat", value.GetLatitudeNorthPositive().ToString());
                GPUserDefaults.SetStringForKey("myloc.lon", value.GetLongitudeEastPositive().ToString());
                GPUserDefaults.SetStringForKey("myloc.tzname", value.getLocation(0).getTimeZoneName());
            }
        }