private void RestoreFromTray() { if (SystemTrayIcon.IsVisible) { Show(); SystemTrayIcon.Hide(); } }
public void LaunchedProcessClosed() { Procedure action = () => { try { FileOperationList.Execute(); } catch (Exception) { // suppress cleanup errors } Demo demo = uiDemoListView.GetSelectedDemo(); if (demo != null && UseHlae(demo)) { Debug.Assert(launcher as SteamLauncher != null); } // If the system tray still has a context menu, then connecting must have been cancelled. // Don't apply the "close when finished" functionality in this case. if (!SystemTrayIcon.HasContextMenuStrip && Config.Settings.PlaybackCloseWhenFinished) { SystemTrayIcon.Hide(); Close(); } else { RestoreFromTray(); canOpenDemo = true; } }; if (Thread.CurrentThread != Dispatcher.Thread) { Dispatcher.Invoke(DispatcherPriority.Normal, action); } else { action(); } }