BrightnessTray.MainWindow.Window_Closing C# (CSharp) Метод

Window_Closing() приватный Метод

Window closing method. Disposes of the notify icon, removes the custom window procedure and releases user preference change handlers.
private Window_Closing ( object sender, System e ) : void
sender object The sender of the message.
e System Cancel event arguments.
Результат void
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            eventWatcher.Dispose();

            // remove the notify icon
            this.NotifyIcon.Visible = false;
            this.NotifyIcon.Dispose();

            if (this.IsLoaded)
            {
                HwndSource source = PresentationSource.FromVisual(this) as HwndSource;
                source.RemoveHook(this.WndProc);
            }

            this.ReleaseHandlers();
        }