Esempio n. 1
0
        public override void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);

            var source = new ParameterSource(replacementsDictionary);
            var doc    = Helpers.LoadWizardXml(replacementsDictionary);
            var ns     = Helpers.WizardNamespace;

            var model = new ProjectWizardPageModel(source, doc.Root.Elements(ns + "Options").FirstOrDefault());

            if (model.SupportsAppName)
            {
                model.AppName = replacementsDictionary["$projectname$"];
            }
            if (model.RequiresInput)
            {
                var panel  = new ProjectWizardPageView(model);
                var dialog = new BaseDialog {
                    Content = panel, Title = model.Title, ClientSize = new Size(-1, 400), Style = "themed"
                };
                if (!dialog.ShowModal(Helpers.MainWindow))
                {
                    throw new WizardBackoutException();
                }
            }
        }
Esempio n. 2
0
        public override void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
            base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);

            var source = new ParameterSource(replacementsDictionary);

            var model = new ProjectWizardPageModel(source);

            if (model.SupportsAppName)
            {
                model.AppName = replacementsDictionary["$projectname$"];
            }
            if (model.RequiresInput)
            {
                var panel  = new ProjectWizardPageView(model);
                var dialog = new BaseDialog {
                    Content = panel, Title = model.Title, ClientSize = new Size(-1, 400), Style = "eto.vstheme"
                };
                if (!dialog.ShowModal(Helpers.MainWindow))
                {
                    throw new WizardBackoutException();
                }

                // super hack: Due to a bug in VS we cannot use item templates without it crashing..
                // see Microsoft.VisualStudio.TemplateEngine.Wizard.TemplateEngineWizard.PostInvocationTelemetry
                // for details on why it doesn't work...
                if (customParams[0] is string str && !str.Contains("~PC"))
                {
                    str             = str.Replace("~IC", "~PC");
                    customParams[0] = str;
                }
            }
        }
Esempio n. 3
0
        protected override object CreateNativeWidget <T>()
        {
            if (view == null)
            {
                view = new ProjectWizardPageView(model);
            }

            return(XamMac2Helpers.ToNative(view, true));
        }
Esempio n. 4
0
        protected override object CreateNativeWidget <T>()
        {
            if (view == null)
            {
                view = new ProjectWizardPageView(model);
            }

#if Mac
            if (Platform.Instance.IsMac)
            {
                return(XamMac2Helpers.ToNative(view, true));
            }
            else
#endif
            return(Gtk2Helpers.ToNative(view, true));
        }
Esempio n. 5
0
        public override void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);

            var source = new ParameterSource(replacementsDictionary);
            var model  = new ProjectWizardPageModel(source);

            model.AppName = replacementsDictionary["$projectname$"];
            if (model.RequiresInput)
            {
                var panel  = new ProjectWizardPageView(model);
                var dialog = new BaseDialog {
                    Content = panel, Title = model.Title
                };
                if (!dialog.ShowModal(Helpers.MainWindow))
                {
                    throw new WizardBackoutException();
                }
            }
        }
Esempio n. 6
0
 protected override object CreateNativeWidget()
 {
     return((view ?? (view = new ProjectWizardPageView(model))).ToNative(true));
 }