Exemplo n.º 1
0
        /// <summary>
        /// Highlights the graph elements that need to be highlighted.
        /// </summary>
        /// <param name="graphView">The graph view.</param>
        public static void HighlightGraphElements(this GraphView graphView)
        {
            graphView.ClearGraphElementsHighlight();

            if (graphView.GetSelection().Count == 0)
            {
                return;
            }

            IEnumerable <IHighlightable> highlightables = graphView.Highlightables.ToList();

            // For all the selected items, highlight the graphElements that share the same declaration model
            // Exception: If the graphElement is selected, do not highlight it
            foreach (var selectable in graphView.GetSelection())
            {
                foreach (var highlightable in highlightables
                         .Where(h => (!Equals(selectable, h.Model) || !ReferenceEquals(selectable, h.Model)) &&
                                h.ShouldHighlightItemUsage(selectable)))
                {
                    highlightable.Highlighted = true;
                }
            }
        }
Exemplo n.º 2
0
 public override void OnUnselected()
 {
     base.OnUnselected();
     GraphView.ClearGraphElementsHighlight(ShouldHighlightItemUsage);
 }