Interaction logic for SetupWizard.xaml
Inheritance: System.Windows.Window
示例#1
0
        public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            _dte = (DTE)automationObject;


            _shouldAddProjectItem = false;
            var inputForm = new WizardView();

            inputForm.ShowDialog();
            if (inputForm.OwnerEmail == null || inputForm.RootNameSpace == null || inputForm.OwnerName == null || inputForm.OwnerWebsite == null || inputForm.DevEnvironmentUrl == null)
            {
                return;
            }
            _shouldAddProjectItem = true;
            /* remove them first so there isn't any conflict, they get added by the project templates themselves originally */
            replacementsDictionary.Remove("$rootnamespace$");
            replacementsDictionary.Remove("$ownername$");
            replacementsDictionary.Remove("$owneremail$");
            replacementsDictionary.Remove("$ownerwebsite$");
            replacementsDictionary.Remove("$devenvironmenturl$");

            replacementsDictionary.Add("$rootnamespace$", inputForm.RootNameSpace);
            replacementsDictionary.Add("$ownername$", inputForm.OwnerName);
            replacementsDictionary.Add("$owneremail$", inputForm.OwnerEmail);
            replacementsDictionary.Add("$ownerwebsite$", inputForm.OwnerWebsite);
            replacementsDictionary.Add("$devenvironmenturl$", inputForm.DevEnvironmentUrl);
        }
示例#2
0
        public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            _dte = (DTE)automationObject;

            // Ask the user for the necessary parameters.
            WizardView inputForm = null;

            while (inputForm == null || inputForm.PassesValidation() == false)
            {
                // If this is our first time in the loop, init with default parameters.
                if (inputForm == null)
                {
                    inputForm = new WizardView(RootNameSpace, OwnerName, OwnerEmail, OwnerWebsite, DevEnvironmentUrl);
                }
                // Otherwise, init with the parameters the user entered last time.
                else
                {
                    inputForm = new WizardView(inputForm.RootNameSpace, inputForm.OwnerName, inputForm.OwnerEmail, inputForm.OwnerWebsite, inputForm.DevEnvironmentUrl);
                }

                // ShowDialog will return false when the user cancels the dialog.
                if (inputForm.ShowDialog() == false)
                {
                    throw new WizardCancelledException("Action was cancelled by the user.");
                }
            }

            // Update our parameters with the user input.
            RootNameSpace     = inputForm.RootNameSpace;
            OwnerName         = inputForm.OwnerName;
            OwnerEmail        = inputForm.OwnerEmail;
            OwnerWebsite      = inputForm.OwnerWebsite;
            DevEnvironmentUrl = inputForm.DevEnvironmentUrl;

            // Remove them first so there isn't any conflict, they get added by the project templates themselves originally
            replacementsDictionary.Remove("$rootnamespace$");
            replacementsDictionary.Remove("$ownername$");
            replacementsDictionary.Remove("$owneremail$");
            replacementsDictionary.Remove("$ownerwebsite$");
            replacementsDictionary.Remove("$devenvironmenturl$");

            replacementsDictionary.Add("$rootnamespace$", RootNameSpace);
            replacementsDictionary.Add("$ownername$", OwnerName);
            replacementsDictionary.Add("$owneremail$", OwnerEmail);
            replacementsDictionary.Add("$ownerwebsite$", OwnerWebsite);
            replacementsDictionary.Add("$devenvironmenturl$", DevEnvironmentUrl);
        }
示例#3
0
        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            _dte = (DTE)automationObject;

            _shouldAddProjectItem = false;
            var inputForm = new WizardView();
            inputForm.ShowDialog();
            if (inputForm.OwnerEmail == null || inputForm.RootNameSpace == null || inputForm.OwnerName == null || inputForm.OwnerWebsite == null || inputForm.DevEnvironmentUrl == null) return;
            _shouldAddProjectItem = true;
            /* remove them first so there isn't any conflict, they get added by the project templates themselves originally */
            replacementsDictionary.Remove("$rootnamespace$");
            replacementsDictionary.Remove("$ownername$");
            replacementsDictionary.Remove("$owneremail$");
            replacementsDictionary.Remove("$ownerwebsite$");
            replacementsDictionary.Remove("$devenvironmenturl$");

            replacementsDictionary.Add("$rootnamespace$", inputForm.RootNameSpace);
            replacementsDictionary.Add("$ownername$", inputForm.OwnerName);
            replacementsDictionary.Add("$owneremail$", inputForm.OwnerEmail);
            replacementsDictionary.Add("$ownerwebsite$", inputForm.OwnerWebsite);
            replacementsDictionary.Add("$devenvironmenturl$", inputForm.DevEnvironmentUrl);
        }