internal void ShowHoverMessage(string msg, Point scrPt) { if (_form == null || _form.IsDisposed) { _form = new Sce.Atf.Controls.HoverLabel(""); } _form.Label = msg; _form.Location = scrPt; _form.ShowWithoutFocus(); if (_timer == null) { _timer = new System.Threading.Timer( (t) => { var hoverClient = ((WeakReference)t).Target as HoverClient; if (hoverClient != null) { hoverClient._syncContext.Post(new System.Threading.SendOrPostCallback(OnTimeout), hoverClient); } }, new WeakReference(this), 5000, System.Threading.Timeout.Infinite); } else { _timer.Change(5000, System.Threading.Timeout.Infinite); } }
public void Dispose() { if (_form != null) { _form.Dispose(); _form = null; } if (_timer != null) { _timer.Dispose(); _timer = null; } }