public Element AddToSelection(Point location) { var elem = _selectionResolver.GetElementFromLocation(location); if (elem != null && !_selectedElements.Contains(elem)) { _selectedElements.Add(elem); } return(elem); }
public Element AddToSelection(Position position) { RefreshSelection(); var elem = _selectionResolver.GetElementFromLocation(position); if (elem != null && !_selectedElements.Contains(elem)) { _selectedElements.Add(elem); } return(elem); }
public void Show(Point location) { if (!Validate(location)) { return; } Destroy.Disposable(ref timeout); Destroy.Disposable(ref tipInfo); timeout = new System.Timers.Timer(); timeout.AutoReset = false; timeout.Enabled = true; timeout.Interval = 500; timeout.Elapsed += (s, ev) => { Destroy.Disposable(ref timeout); Destroy.Disposable(ref tipInfo); var elem = _selectionResolver.GetElementFromLocation(location); if (elem != null) { tipInfo = new ToolTip { AutomaticDelay = 0, AutoPopDelay = 0, InitialDelay = 0, ReshowDelay = 0, ToolTipIcon = ToolTipIcon.Info, UseFading = true, ToolTipTitle = elem.Id }; string text = GetElementText(elem); Action action = () => tipInfo?.Show(text, _controlToToolTip); if (_controlToToolTip.InvokeRequired) { _controlToToolTip.Invoke(action); } else { action(); } lastToolTipLocation = location; } }; timeout.Start(); }
public void Show(Position position) { if (!Validate(position)) { return; } Destroy.Disposable(ref timeout); Destroy.Disposable(ref tipInfo); timeout = new System.Timers.Timer { AutoReset = false, Enabled = true, Interval = 500 }; timeout.Elapsed += (s, ev) => { Destroy.Disposable(ref timeout); Destroy.Disposable(ref tipInfo); var elem = _selectionResolver.GetElementFromLocation(position); if (elem != null) { tipInfo = new ToolTip { AutomaticDelay = 0, AutoPopDelay = 0, InitialDelay = 0, ReshowDelay = 0, ToolTipIcon = ToolTipIcon.Info, UseFading = true, ToolTipTitle = elem.Id }; string text = GetElementText(elem); _invoker.SafeInvoke(() => tipInfo?.Show(text, _controlToToolTip)); lastToolTipLocation = position; } }; timeout.Start(); }