public void Start() { try { Initialise(); RunInitialCheck(); } catch (Exception e) { Log.EnableFileLogging(); Log.Send("Could not start pass-winmenu: An exception occurred.", LogLevel.Error); Log.ReportException(e); if (e is DependencyResolutionException de && de.InnerException != null) { e = de.InnerException; } string errorMessage = $"pass-winmenu failed to start ({e.GetType().Name}: {e.Message})"; if (notificationService == null) { // We have no notification service yet. Instantiating one is risky, // so we'll make do with a call to MessageBox.Show() instead. MessageBox.Show(errorMessage, "An error occurred.", MessageBoxButton.OK, MessageBoxImage.Error); } else { notificationService.ShowErrorWindow(errorMessage); notificationService.Dispose(); } App.Exit(); } }
public void Dispose() { notificationService?.Dispose(); updateChecker?.Dispose(); container?.Dispose(); }
public void Dispose() { git?.Dispose(); notificationService?.Dispose(); hotkeys?.Dispose(); }
public void Dispose() { Notifications?.Dispose(); SelectedNotification?.Dispose(); }
private void Options_FormClosing(object sender, FormClosingEventArgs e) { _connections.Dispose(); _notifications.Dispose(); _proxy.Dispose(); }