Exemple #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            Settings settings = Settings.Default;

            MainWindow window = new MainWindow();
            window.Show();

            if (String.IsNullOrEmpty(settings.MantisConnectUrl) ||
                String.IsNullOrEmpty(settings.MantisUsername) ||
                String.IsNullOrEmpty(settings.MantisPassword))
            {
                LoginWindow loginWindow = new LoginWindow();
                loginWindow.Owner = window;
                bool? loginDialogResult = loginWindow.ShowDialog();

                if (!loginDialogResult.Value)
                {
                    Shutdown();
                }
            }

            if (!MantisService.IsLoggedIn)
            {
                MantisService.Login(settings.MantisConnectUrl, settings.MantisUsername, settings.MantisPassword, settings.HttpAuthUsername, settings.HttpAuthPassword, null);
            }
        }
 private void NewInstanceButton_Click(object sender, RoutedEventArgs e)
 {
     MainWindow mainWindow = new MainWindow();
     mainWindow.Show();
 }