private void Application_Exit(object sender, ExitEventArgs e) { if (trayIcon != null) { trayIcon.Dispose(); trayIcon = null; } logWriter.WriteLine("LiveReload says bye."); logWriter.Flush(); }
public void RestartBackend() { window.Hide(); window = null; rpcRoot = null; nodeFoo.Dispose(); nodeFoo = null; trayIcon.Dispose(); trayIcon = null; StartUI(); }
private void StartUI() { window = new MainWindow(); window.MainWindowHideEvent += HandleMainWindowHideEvent; window.NodeMessageEvent += HandleNodeMessageEvent; window.buttonVersion.Content = "v" + Version; window.gridProgress.Visibility = Visibility.Visible; window.Show(); trayIcon = new TrayIconController(); trayIcon.MainWindowHideEvent += HandleMainWindowHideEvent; trayIcon.MainWindowShowEvent += HandleMainWindowShowEvent; trayIcon.MainWindowToggleEvent += HandleMainWindowToggleEvent; // has to be done before launching Node BeginExtractBundledResources(Application_ContinueStartupAfterExtraction); }