protected override void Dispose(bool bDisposing) { base.Dispose(bDisposing); if (Components != null) { Components.Dispose(); Components = null; } if (NotifyIcon != null) { NotifyIcon.Dispose(); NotifyIcon = null; } if (Log != null) { Log.Dispose(); Log = null; } if (UpdateMonitor != null) { UpdateMonitor.OnUpdateAvailable -= OnUpdateAvailableCallback; UpdateMonitor.Close(); // prevent race condition UpdateMonitor = null; } if (ActivationListener != null) { ActivationListener.OnActivate -= OnActivationListenerAsyncCallback; ActivationListener.Stop(); ActivationListener.Dispose(); ActivationListener = null; } if (MainWindowInstance != null) { MainWindowInstance.ForceClose(); MainWindowInstance = null; } if (DetectStartupProjectSettingsWindow != null) { DetectStartupProjectSettingsWindow.Close(); DetectStartupProjectSettingsWindow = null; } }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } for (int Idx = 0; Idx < TabControl.GetTabCount(); Idx++) { ((WorkspaceControl)TabControl.GetTabData(Idx)).Dispose(); } if (ActivationListener != null) { ActivationListener.Dispose(); ActivationListener = null; } StopScheduleTimer(); base.Dispose(disposing); }