Share via

'Method is not implemented' error is displayed when clicked on 'Cancel' button.The throwing of WizardCancelledException doesn't work

vaibhav4242 1 Reputation point
2021-12-14T16:19:24.54+00:00
 protected override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary,
             WizardRunKind runKind, object[] customParams)
        {
            BaseTestTools defaultTestTool = BaseTestTools.Default;
            var dte = (DTE)automationObject;
            if (!bool.Parse(replacementsDictionary["$exclusiveproject$"]))
            {
                defaultTestTool = ProjectAutomationHelper.GetSolutionTestToolBasedOnBizLib(dte.Solution);
            }
            this.inputForm = new FuncTestWizardForm(replacementsDictionary["$safeprojectname$"], defaultTestTool);
            DialogResult result = this.inputForm.ShowDialog();
            logger.Trace("result from Dilaogresult ");
            if (result == DialogResult.OK)
            {
                string suiteName = this.inputForm.GetSuiteName();
                int automationTarget = this.inputForm.GetAutomationTarget();
                this.baseTestTool = this.inputForm.GeBaseTestTool();
                addBaseToolUsings(this.baseTestTool, ref replacementsDictionary);
                replacementsDictionary.Add("$suitename$", XmlEscapeHelper.EscapeString(suiteName));
                replacementsDictionary.Add("$automationtarget$", automationTarget.ToString("D"));
                replacementsDictionary.Add("$studioversion$", dte.Version);

                MtmProjectSettings mtmSettings = this.inputForm.GetMtmProjectSettings();

                if (mtmSettings.IsReportingEnabled)
                {
                    replacementsDictionary.Add("$mtmserver$", mtmSettings.MtmServerUrl);
                    replacementsDictionary.Add("$mtmproject$", mtmSettings.MtmTestProject);
                }
                else
                {
                    replacementsDictionary.Add("$mtmserver$", string.Empty);
                    replacementsDictionary.Add("$mtmproject$", string.Empty);
                }
            }
            if (result == DialogResult.Cancel)
            {
                    ProjectAutomationHelper.CleanupProjectDirectory(replacementsDictionary);
                    throw new WizardCancelledException();
            }
            if (result == DialogResult.Abort)
            {
                ProjectAutomationHelper.CleanupProjectDirectory(replacementsDictionary);
                throw new WizardBackoutException();
            }
        }
Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.