Exemple #1
0
        public void DeleteEvent(HistoryEvent @event)
        {
            this.events.Remove(@event);

            HistoryEventArgs eargs = new HistoryEventArgs(HistoryEventTypes.REMOVED);
            eargs.AddExtra(HistoryEventArgs.EXTRA_EVENT, @event);
            EventHandlerTrigger.TriggerEvent<HistoryEventArgs>(this.onHistoryEvent, this, eargs);

            this.DeferredSave();
        }
        private void historyService_onHistoryEvent(object sender, HistoryEventArgs e)
        {
            if (e.Type != HistoryEventTypes.RESET)
            {
                return;
            }

            if (this.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
            {
                this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
                        new EventHandler<HistoryEventArgs>(this.historyService_onHistoryEvent), sender, new object[] { e });
                return;
            }

               this.UpdateSource();
        }
Exemple #3
0
        public void AddEvent(HistoryEvent @event)
        {
            this.events.Insert(0, @event);

            HistoryEventArgs eargs = new HistoryEventArgs(HistoryEventTypes.ADDED);
            eargs.AddExtra(HistoryEventArgs.EXTRA_EVENT, @event);
            EventHandlerTrigger.TriggerEvent<HistoryEventArgs>(this.onHistoryEvent, this, eargs);

            this.DeferredSave();
        }
Exemple #4
0
        public void UpdateEvent(HistoryEvent @event)
        {
            HistoryEventArgs eargs = new HistoryEventArgs(HistoryEventTypes.UPDATED);
            eargs.AddExtra(HistoryEventArgs.EXTRA_EVENT, @event);
            EventHandlerTrigger.TriggerEvent<HistoryEventArgs>(this.onHistoryEvent, this, eargs);

            this.DeferredSave();
        }