Example #1
0
 private void _wizardButton_Click(object sender, EventArgs e)
 {
     try
     {
         using (var dlg = new TestWizard(false))
         {
             var result = dlg.ShowDialog();
             if (result == DialogResult.OK)
             {
                 var collection = dlg.GetNewCollectionSettings();
                 _wizardOutputLabel.Text = String.Format("Wizard set project = {0}", collection.CollectionName);
             }
             else
             {
                 _wizardOutputLabel.Text = @"WIZARD CANCELLED";
             }
         }
     }
     catch (Exception ex)
     {
         _wizardOutputLabel.Text = @"CRASH! " + ex.Message;
         Console.WriteLine("CRASH: {0}", ex.Message);
         Console.WriteLine(ex.StackTrace);
     }
 }
        public static string CreateNewCollection(Action uiLanguageChangedAction)
        {
            bool showTestWizard = false;

            using (var dlg = new TestWizard(showTestWizard))
            {
                dlg.UiLanguageChanged = uiLanguageChangedAction;
                dlg.ShowInTaskbar     = showTestWizard;            //if we're at this stage, there isn't a bloom icon there already.
                if (DialogResult.OK != dlg.ShowDialog())
                {
                    return(null);
                }
                //review: this is a bit weird... we clone it instead of just using it just because this code path
                //can handle creating the path from scratch
                return(new CollectionSettings(dlg.GetNewCollectionSettings()).SettingsFilePath);
            }
        }