// Deselect all other elements. public override void SelectOnlyElement(GraphicElement el) { List <GraphicElement> intersections = FindAllIntersections(el).ToList(); List <GraphicElement> deselectedElements = new List <GraphicElement>(); selectedElements.Where(e => e != el).ForEach(e => { intersections.AddRange(FindAllIntersections(e)); e.Deselect(); deselectedElements.Add(e); }); if (!selectedElements.Contains(el)) { selectedElements.Add(el); el.Select(); } deselectedElements.ForEach(e => selectedElements.Remove(e)); EraseTopToBottom(intersections); DrawBottomToTop(intersections); UpdateScreen(intersections); ElementSelected.Fire(this, new ElementEventArgs() { Element = el }); }
public override void SelectElement(GraphicElement el) { // Add to selected elements only once! if (!selectedElements.Contains(el)) { var els = EraseIntersectionsTopToBottom(el); selectedElements.Add(el); el.Select(); DrawBottomToTop(els); UpdateScreen(els); ElementSelected.Fire(this, new ElementEventArgs() { Element = el }); } }
public override void SelectElement(GraphicElement el) { // Add to selected elements only once! if (!selectedElements.Contains(el)) { var els = EraseIntersectionsTopToBottom(el); selectedElements.Add(el); el.Select(); DrawBottomToTop(els); UpdateScreen(els); ElementSelected.Fire(this, new ElementEventArgs() { Element = el }); // Added this to support the NavTo feature, so that the element // can override this behavior (which is empty in the GraphicElement) // to do other things AFTER the rendering of the selected element has taken place. el.ElementSelected(); } }