コード例 #1
0
        public static void Start()
        {
            if (!CevioSubscriber.IsRunning)
            {
                CevioSubscriber.Run();
            }

            if (!Config.IsHideCevioWindow)
            {
                return;
            }

            lock (Locker)
            {
                if (trayWindow == null)
                {
                    trayWindow = new CevioTrayWindow();
                    trayWindow.Show();

                    WPFHelper.CurrentApp.Exit += (_, __) =>
                    {
                        RestoreWindow();
                        End();
                    };

                    WPFHelper.CurrentApp.DispatcherUnhandledException += (_, __) =>
                    {
                        RestoreWindow();
                        End();
                    };
                }
            }
        }
コード例 #2
0
 public static void End()
 {
     lock (Locker)
     {
         if (trayWindow != null)
         {
             trayWindow.CevioIcon.Visibility = Visibility.Collapsed;
             trayWindow.Close();
             trayWindow = null;
         }
     }
 }