コード例 #1
0
 public void SaveTrk(Trk trk)
 {
     string ins = $"insert into trk values(?,?,?)";
     object[] args = new object[] { null, trk.Title, trk.Tijdstip.ToString("yyy MM dd HH:mm:ss") };
     int id = SQLiteService.ExecuteInsert(ins, args);
     trk.ID = id;
 }
コード例 #2
0
 public ObservableCollection<TrkPt> TrkPts(Trk trk)
 {
     String sql = "select * from trkpt where (trkid = ?)";
     object[] args = new object[] { trk.ID };
     var l = Select(sql);
     ObservableCollection<TrkPt> oc = new ObservableCollection<TrkPt>(l);
     return oc;
 }
コード例 #3
0
        private void NewTrack()
        {
            Trk trk = new Trk();
            TrkRepository repo = new TrkRepository();
            trk.Title = "Trk test";
            trk.Tijdstip = DateTime.Now;
            repo.SaveTrk(trk);

            Tracker tracker = new Tracker();
            tracker.CurrentTrk = trk;
            tracker._isStarted = true;
            
        }
コード例 #4
0
        private MapPolyline MakePolyline(Trk trk)
        {
            if (trk == null) return null;

            MapPolyline polyline = new MapPolyline();
            polyline.StrokeColor = Colors.Red;
            polyline.StrokeThickness = 2;
            List<BasicGeoposition> pos = new List<BasicGeoposition>();
            BasicGeoposition bpos;

            foreach (TrkPt pt in trk.TrkPts)
            {
                bpos = new BasicGeoposition();
                bpos.Latitude = pt.Latitude;
                bpos.Longitude = pt.Longitude;
                pos.Add(bpos);
            }

            Geopath p = new Geopath(pos);
            polyline.Path = p;

            return polyline;
        }