Interaction logic for TimelineItem.xaml
Inheritance: System.Windows.Controls.UserControl
Ejemplo n.º 1
0
 internal void ShowEvent(TimelineItem ti)
 {
     Item = ti;
     LastMove = DateTime.Now;
     bEvent.Visibility = Visibility.Visible;
     dt.Stop();
 }
Ejemplo n.º 2
0
 internal void ShowEvent(IEvent ti)
 {
     Item = new TimelineItem(AppStateSettings.Instance.TimelineManager)
         {
             EventPoint = new KmlPoint(ti.Longitude,ti.Latitude)
         };
     tbText.Text = ti.Name;
     LastMove = DateTime.Now;
     bEvent.Visibility = Visibility.Visible;
     dt.Stop();
 }
Ejemplo n.º 3
0
 public void RemoveItemFromTimeline(TimelineItem tlItem)
 {
     //if (!timelineItems.Contains(tlItem)) return;
     //timelineItems.Remove(tlItem);
     //Draw();
 }
Ejemplo n.º 4
0
        //private readonly List<TimelineItem> timelineItems = new List<TimelineItem>();

        public void AddItemToTimeline(TimelineItem tlItem)
        {
            //if (timelineItems.Contains(tlItem)) return;
            //timelineItems.Add(tlItem);
            //Draw();
        }
Ejemplo n.º 5
0
        void UpdateTimeline(Envelope env)
        {
            if (env == null)
                env = AppState.ViewDef.MapControl.Extent;
            envelope = env;
            var tlm = AppState.TimelineManager;

            var addlist = new List<IEvent>();
            var remlist = new List<IEvent>();
            foreach ( var el in AppState.EventLists.ToList())
            foreach (var e in el.ToList())
            {
                try
                {
                    if (e.InsideEnvelope(env)) {
                        if (items.All(k => k.Id != e.Id)) {
                            addlist.Add(e);
                        }
                    }
                    else {
                        if (items.All(k => k.Id != e.Id)) continue;
                        var r = items.FirstOrDefault(k => k.Id == e.Id);
                        remlist.Add(r);
                    }
                }
                catch (Exception err)
                {
                    Console.WriteLine(err.ToString());
                }
            }

            Execute.OnUIThread(() => {
                foreach (var r in remlist) {
                    var remitem = TlItems.FirstOrDefault(k => k.Id == r.Id);
                    if (remitem != null) {
                        if (TimelineView.TimelineViewInstance != null)
                            TimelineView.TimelineViewInstance.RemoveItemFromTimeline(remitem);
                        TlItems.Remove(remitem);
                    }
                    items.Remove(r);
                }
                foreach (var i in addlist) {
                    items.Add(i);
                    var tlItem = new TimelineItem(tlm) {
                        ItemRange    = i.TimeRange,
                        Text         = i.Name,
                        ItemDateTime = i.Date,
                        EventPoint   = new KmlPoint(i.Longitude, i.Latitude),
                        Id           = i.Id
                    };

                    TlItems.Add(tlItem);
                    if (TimelineView.TimelineViewInstance != null)
                        TimelineView.TimelineViewInstance.AddItemToTimeline(tlItem);
                    tlItem._tlManager_TimeChanged(null, null);
                }
            });
        }