Пример #1
0
        public override void FinalizeRun()
        {
            TotalProcessTime.Start();

            List <GSAKWrapper.MapProviders.GeocachePoco> gcl = null;
            double?cLat = null;
            double?cLon = null;

            using (var db = new NPoco.Database(DatabaseConnection.Connection, NPoco.DatabaseType.SQLite))
            {
                gcl = db.Fetch <GSAKWrapper.MapProviders.GeocachePoco>(string.Format("select Code, Name, CacheType, Found, IsOwner, Latitude, Longitude, kAfterLat, kAfterLon from Caches inner join {0} on Caches.Code={0}.gccode left join Corrected on Caches.Code=Corrected.kCode", ActionInputTableName));
            }
            if (gcl.Count > 0)
            {
                var dr = DatabaseConnection.ExecuteReader(string.Format("select AVG(Latitude), AVG(Longitude) from Caches inner join {0} on Caches.Code={0}.gccode left join Corrected on Caches.Code=Corrected.kCode", ActionInputTableName));
                if (dr.Read())
                {
                    cLat = dr.GetDouble(0);
                    cLon = dr.GetDouble(1);
                }
            }

            _context.Send(new SendOrPostCallback(delegate(object state)
            {
                var wnd = new Dialogs.WindowOSMOfflineMap(gcl, cLat, cLon, 16);
                wnd.Show();
            }), null);

            TotalProcessTime.Stop();
            base.FinalizeRun();
        }
        public override void FinalizeRun()
        {
            TotalProcessTime.Start();

            List<GSAKWrapper.MapProviders.GeocachePoco> gcl = null;
            double? cLat = null;
            double? cLon = null;
            using (var db = new NPoco.Database(DatabaseConnection.Connection, NPoco.DatabaseType.SQLite))
            {
                gcl = db.Fetch<GSAKWrapper.MapProviders.GeocachePoco>(string.Format("select Code, Name, CacheType, Found, IsOwner, Latitude, Longitude, kAfterLat, kAfterLon from Caches inner join {0} on Caches.Code={0}.gccode left join Corrected on Caches.Code=Corrected.kCode", ActionInputTableName));
            }
            if (gcl.Count > 0)
            {
                var dr = DatabaseConnection.ExecuteReader(string.Format("select AVG(Latitude), AVG(Longitude) from Caches inner join {0} on Caches.Code={0}.gccode left join Corrected on Caches.Code=Corrected.kCode", ActionInputTableName));
                if (dr.Read())
                {
                    cLat = dr.GetDouble(0);
                    cLon = dr.GetDouble(1);
                }
            }

            _context.Send(new SendOrPostCallback(delegate(object state)
            {
                var wnd = new Dialogs.WindowOSMOfflineMap(gcl, cLat, cLon, 16);
                wnd.Show();
            }), null);

            TotalProcessTime.Stop();
            base.FinalizeRun();
        }
Пример #3
0
        void b_Click(object sender, RoutedEventArgs e)
        {
            var wnd = new Dialogs.WindowOSMOfflineMap(null, null, null, 13);

            wnd.Show();
        }
 void b_Click(object sender, RoutedEventArgs e)
 {
     var wnd = new Dialogs.WindowOSMOfflineMap(null, null, null, 13);
     wnd.Show();
 }