protected override void Dispose(bool disposing) { base.Dispose(disposing); if (statusIcon != null) { statusIcon.Dispose(); } }
protected void OnDeleteEvent(object sender, DeleteEventArgs a) { // Added because the icon wasn't removed when the application was closed trayIcon.Dispose(); theTimer.Dispose(); Application.Quit(); a.RetVal = true; }
public void Dispose() { try { _trayIcon.Dispose(); _sleepInhibitor.Dispose(); GC.SuppressFinalize(this); } catch { } }
public static void Shutdown() { if (trayIcon != null) { trayIcon.Visible = false; trayIcon.Dispose(); trayIcon = null; } if (_mainWindow != null) { _mainWindow.HideAll(); _mainWindow.Dispose(); _mainWindow = null; } Application.Quit(); }
//literally, destroy all our gui stuff private void DestroyEverything() { if (hbox != null) { hbox.Destroy(); } if (vbox != null) { vbox.Destroy(); } if (newi != null) { newi.Destroy(); } if (menuBar != null) { menuBar.Destroy(); } if (filemenu != null) { filemenu.Destroy(); } if (file != null) { file.Destroy(); } if (sep != null) { sep.Destroy(); } if (exit != null) { exit.Destroy(); } if (uploadButton != null) { uploadButton.Destroy(); } if (toCropBox != null) { toCropBox.Destroy(); } if (appimg != null) { appimg.Destroy(); } if (menuItemQuit != null) { menuItemQuit.Destroy(); } if (popupMenu != null) { popupMenu.Destroy(); } if (notificationMessage != null) { notificationMessage.Destroy(); } if (notificationEventBox != null) { notificationEventBox.Destroy(); } if (mainWindowTracker != null) { mainWindowTracker.Destroy(); } if (trayIcon != null) { trayIcon.Dispose(); } if (agr != null) { agr.Dispose(); } }
public void Dispose() { statusIcon.Visible = false; statusIcon.Dispose(); }