public TrayIcon() { this._doubleClick = false; this._visible = false; this._id = ++nextId; this._text = string.Empty; this.window = new TrayIconNativeWindow(this); }
protected override void Dispose(bool disposing) { if (disposing) { if (this.window != null) { this.UpdateIcon(false); this.window.DestroyHandle(); this.window = null; this._icon = null; this._text = string.Empty; } this._owner = null; } else if ((this.window != null) && (this.window.Handle != IntPtr.Zero)) { Interop.PostMessage(this.window.Handle, 0x10, IntPtr.Zero, IntPtr.Zero); this.window.ReleaseHandle(); } base.Dispose(disposing); }