Пример #1
0
        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();
            }
        }
Пример #2
0
 public void Dispose()
 {
     notificationService?.Dispose();
     updateChecker?.Dispose();
     container?.Dispose();
 }
Пример #3
0
 public void Dispose()
 {
     git?.Dispose();
     notificationService?.Dispose();
     hotkeys?.Dispose();
 }
Пример #4
0
 public void Dispose()
 {
     Notifications?.Dispose();
     SelectedNotification?.Dispose();
 }
Пример #5
0
 private void Options_FormClosing(object sender, FormClosingEventArgs e)
 {
     _connections.Dispose();
     _notifications.Dispose();
     _proxy.Dispose();
 }