Ejemplo n.º 1
0
 private void ToggleServerStatus_Click(object sender, MouseButtonEventArgs e)
 {
     if (Code.Server.AditServer.IsEnabled)
     {
         e.Handled = true;
         var result = MessageBox.Show("Your server is currently running.  Are you sure you want to stop it?", "Confirm Shutdown", MessageBoxButton.YesNo, MessageBoxImage.Warning);
         if (result == MessageBoxResult.No)
         {
             return;
         }
         AditServer.Stop();
         toggleServerStatus.IsOn = false;
     }
     else
     {
         AditServer.Start();
     }
 }
Ejemplo n.º 2
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (Initializer.IsFirstLoad)
            {
                Initializer.SetGlobalErrorHandler();
                Initializer.SetShutdownMode();
                Config.Load();
                await Initializer.ProcessCommandLineArgs(Environment.GetCommandLineArgs());

                if (Config.Current.StartupMode != Config.StartupModes.Notifier)
                {
                    TrayIcon.Create();
                    if (Config.Current.IsServerAutoStartEnabled)
                    {
                        AditServer.Start();
                    }
                }
            }

            ProcessConfiguration();

            Initializer.IsFirstLoad = false;
        }