Esempio n. 1
0
        private static void OnHoveredEventPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            EventsTree traceTreeView = (EventsTree)sender;

            if (traceTreeView == null)
            {
                return;
            }
            IDictionary <IEvent, EventsTreeItem> eventsTable = traceTreeView.EventsTable;
            IEvent         oldEvent = e.OldValue as IEvent;
            IEvent         newEvent = e.NewValue as IEvent;
            EventsTreeItem oldTraceTreeViewItem;
            EventsTreeItem newTraceTreeViewItem;

            if (oldEvent != null)
            {
                if (eventsTable.TryGetValue(oldEvent, out oldTraceTreeViewItem))
                {
                    oldTraceTreeViewItem.IsHovered = false;
                }
            }
            if (newEvent != null)
            {
                if (eventsTable.TryGetValue(newEvent, out newTraceTreeViewItem))
                {
                    newTraceTreeViewItem.IsHovered = true;
                }
            }
        }
 public EventsTreeItem(IEvent @event, IEventFormatter eventFormatter, EventsTree treeView)
 {
     _event           = @event;
     _hasChildren     = @event.HasChildren;
     _treeView        = treeView;
     _eventFormatter  = eventFormatter;
     _notifySelection = true;
 }
Esempio n. 3
0
        private static void OnTracesPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            EventsTree traceTreeView = (EventsTree)sender;

            if (traceTreeView != null)
            {
                traceTreeView.InitializeTrees();
            }
        }
Esempio n. 4
0
        private static void OnSelectedEventPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            EventsTree view = (EventsTree)sender;

            if (view == null)
            {
                return;
            }
            IEvent oldEvent = e.OldValue as IEvent;
            IEvent newEvent = e.NewValue as IEvent;

            if (oldEvent == newEvent)
            {
                return;
            }
            IDictionary <IEvent, EventsTreeItem> eventsTable = view.EventsTable;

            if (oldEvent != null)
            {
                EventsTreeItem oldItem;
                if (eventsTable.TryGetValue(oldEvent, out oldItem))
                {
                    oldItem.SetIsSelectedInternal(false);
                }
            }
            if (view._navigateSelectedEvent)
            {
                view.Navigate(newEvent);
            }
            if (newEvent != null)
            {
                EventsTreeItem newItem;
                if (eventsTable.TryGetValue(newEvent, out newItem))
                {
                    newItem.SetIsSelectedInternal(true);
                }
            }
        }