Inheritance: DialogForm
Example #1
0
        public override void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            _configuration = new WizardConfiguration(replacementsDictionary);

            using (var form = new WizardForm(_configuration))
            {
                if (form.ShowDialog() != DialogResult.OK)
                {
                    throw new WizardBackoutException();
                }
            }

            // A few variables are still missing.

            _configuration.ReplacementsDictionary["$rootnamespace$"] = _configuration.ReplacementsDictionary["$safeprojectname$"];
            _configuration.ReplacementsDictionary[ReplacementVariables.PackageClass] = _configuration.ReplacementsDictionary["$packagename$"] + "Package";

            // Seed the replacements dictionary with encoded values.

            SeedEncodedValues();

            var vsTemplatePath = (string)customParams[0];

            using (var reader = XmlReader.Create(
                       vsTemplatePath,
                       new XmlReaderSettings
            {
                XmlResolver = null,
                DtdProcessing = DtdProcessing.Prohibit,
                IgnoreWhitespace = false
            })
                   ) {
                _packages = GetPackageConfiguration(XDocument.Load(reader));
            }
        }
Example #2
0
        public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            _configuration = new WizardConfiguration(replacementsDictionary);

            using (var form = new WizardForm(_configuration))
            {
                if (form.ShowDialog() != DialogResult.OK)
                    throw new WizardBackoutException();
            }

            // A few variables are still missing.

            _configuration.ReplacementsDictionary["$rootnamespace$"] = _configuration.ReplacementsDictionary["$safeprojectname$"];
            _configuration.ReplacementsDictionary[ReplacementVariables.PackageClass] = _configuration.ReplacementsDictionary["$packagename$"] + "Package";

            // Seed the replacements dictionary with encoded values.

            SeedEncodedValues();

            var vsTemplatePath = (string)customParams[0];

            using (var reader = XmlReader.Create(
                vsTemplatePath,
                new XmlReaderSettings
                {
                    XmlResolver = null,
                    DtdProcessing = DtdProcessing.Prohibit,
                    IgnoreWhitespace = false
                })
            ) {
                _packages = GetPackageConfiguration(XDocument.Load(reader));
            }
        }