Ejemplo n.º 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));
            }
        }
Ejemplo n.º 2
0
        public WizardForm(WizardConfiguration configuration)
        {
            if (configuration == null)
                throw new ArgumentNullException("configuration");

            _configuration = configuration;

            _stepControls = LoadStepControls();
            _steps = Enum.GetValues(typeof(WizardStep)).Cast<WizardStep>().ToArray();

            InitializeComponent();

            _title = Text;

            SetCurrentStep(WizardStep.Welcome);
        }
Ejemplo n.º 3
0
        public WizardForm(WizardConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            _configuration = configuration;

            _stepControls = LoadStepControls();
            _steps        = Enum.GetValues(typeof(WizardStep)).Cast <WizardStep>().ToArray();

            InitializeComponent();

            _title = Text;

            SetCurrentStep(WizardStep.Welcome);
        }
Ejemplo n.º 4
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));
            }
        }