当前位置: 首页>>代码示例>>C#>>正文


C# WizardRunKind类代码示例

本文整理汇总了C#中WizardRunKind的典型用法代码示例。如果您正苦于以下问题:C# WizardRunKind类的具体用法?C# WizardRunKind怎么用?C# WizardRunKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WizardRunKind类属于命名空间,在下文中一共展示了WizardRunKind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RunStarted

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            try
            {
                OpenxliveComfirmForm form = new OpenxliveComfirmForm();
                form.ShowDialog();

                if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    CreateWithOpenxlive = form.CreateWithOpenxlive;
                    SolutionName = replacementsDictionary["$projectname$"];

                    if (CreateWithOpenxlive)
                        replacementsDictionary.Add("$CreateWithOpenxlive$", "True");
                    else
                        replacementsDictionary.Add("$CreateWithOpenxlive$", "False");
                }
                else
                {
                    throw new WizardCancelledException();
                }
            }
            catch
            {

            }
        }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:27,代码来源:Cocos2dWizard.cs

示例2: RunStarted

    public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
    {
      try
      {
        // Display a form to the user. The form collects 
        // input for the custom message.
        inputForm = new SolutionSetupForm();
        inputForm.ShowDialog();

        ProxyName = inputForm.ProxyProjectName;
        ServerName = inputForm.ServerProjectName;
        ClientName = inputForm.ClientProjectName;
        OutputDirectory = string.Format("{0}\\Debug\\", replacementsDictionary["$solutiondirectory$"]);
        if (!Directory.Exists(OutputDirectory))
          Directory.CreateDirectory(OutputDirectory);

        // Add custom parameters.
        replacementsDictionary.Add("$proxyname$", ProxyName);
        replacementsDictionary.Add("$servername$", ServerName);
        replacementsDictionary.Add("$clientname$", ClientName);
        replacementsDictionary.Add("$outputdirectory$", OutputDirectory);
      }
      catch (Exception ex)
      {
        MessageBox.Show(ex.ToString());
      }
    }
开发者ID:lancecontreras,项目名称:BCTemplates,代码行数:27,代码来源:SolutionSetupWizard.cs

示例3: RunStarted

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            string runSilent;
            if (replacementsDictionary.TryGetValue("$runsilent$", out runSilent) && bool.TrueString.Equals(runSilent, StringComparison.OrdinalIgnoreCase))
                return;

            string wizardData;
            if (!replacementsDictionary.TryGetValue("$wizarddata$", out wizardData))
                return;

            if (string.IsNullOrWhiteSpace(wizardData))
                return;

            string message;
            try
            {
                XDocument document = XDocument.Parse(wizardData);
                message = document.Root.Value;
            }
            catch (XmlException ex)
            {
                StringBuilder error = new StringBuilder();
                error.AppendLine("Could not parse WizardData element.");
                error.AppendLine();
                error.Append(ex);
                message = error.ToString();
            }

            MessageBox.Show(message);
        }
开发者ID:modulexcite,项目名称:VsixWizardSample,代码行数:30,代码来源:MyWizard.cs

示例4: RunStarted

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            try
            {
                _dte = automationObject as EnvDTE.DTE;
                _projectName = replacementsDictionary["$safeprojectname$"];
                _container = replacementsDictionary["$container$"];
                _solutionDir = System.IO.Path.GetDirectoryName(replacementsDictionary["$destinationdirectory$"]);
                _templateDir = System.IO.Path.GetDirectoryName(customParams[0] as string);

                XamarinFormsNewProjectDialog dialog = new XamarinFormsNewProjectDialog();
                dialog.ShowDialog();
                _dialogResult = dialog.Result;

                if (_dialogResult.Cancelled)
                    throw new WizardBackoutException();
            }
            catch (Exception ex)
            {
                if (Directory.Exists(_solutionDir))
                    Directory.Delete(_solutionDir, true);

                throw;
            }
        }
开发者ID:ethedy,项目名称:Prism,代码行数:25,代码来源:XamarinFormsProjectWizard.cs

示例5: RunStarted

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            DTE dte = automationObject as DTE;

            //Get a reference to the Item currently selected in the Solution Explorer
            SelectedItem item = dte.SelectedItems.Item(1);

            //Check if the $edmxInputFile$ token is already in the replacementDictionnary.
            //If it is, it means the file was added through the "Add Code Generation Item..." menu,
            //and we don't need to set it here. The token was actually set by the
            //Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.AddArtifactGeneratorWizard WizardExtension
            //(see the file StarterKitExtension.ItemTemplate.vstemplate in the StarterKitExtension.ItemTemplate project)
            if (!replacementsDictionary.ContainsKey("$edmxInputFile$"))
            {
                ModelChoser frm = new ModelChoser(dte, item);
                if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    //Substitute the EDMX filename within the template
                    replacementsDictionary.Add("$edmxInputFile$", frm.ModelFile);
                }
                else
                {
                    throw new WizardCancelledException("Action cancelled by user");
                }

            }
        }
开发者ID:jradxl,项目名称:EF-Designer-Extension-Starter-Kit,代码行数:27,代码来源:StarterKitExtensionWizard.cs

示例6: RunStarted

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

            var vs = (automationObject as DTE);
            this.serviceProvider = new ServiceProvider((Ole.IServiceProvider)vs);
        }
开发者ID:StevenVanDijk,项目名称:NuPattern,代码行数:7,代码来源:OpenSolutionBuilderTemplateWizard.cs

示例7: RunStarted

 public void RunStarted(object automationObject,
     Dictionary<string, string> replacementsDictionary,
     WizardRunKind runKind, object[] customParams)
 {
     string safeprojectname = RootWizardImpl.GlobalParameters.Where(p => p.Key == "$safeprojectname$").First().Value;
     replacementsDictionary["$safeprojectname$"] = safeprojectname;
 }
开发者ID:alexliu1987,项目名称:One.VsTemplate,代码行数:7,代码来源:ChildWizardImpl.cs

示例8: RunStarted

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            _dte = (DTE)automationObject;
            _wrongProjectFolder = replacementsDictionary["$destinationdirectory$"];
            _solutionFolder = Path.GetDirectoryName(_wrongProjectFolder);
            _templatePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName((string)customParams[0]), ".."));
            _solutionName = replacementsDictionary["$safeprojectname$"];
            replacementsDictionary.Add("$safesolutionname$", _solutionName);

            var dlg = new WizardForm(_solutionName);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                replacementsDictionary.Add("$connectionstring$", dlg.ConnectinString);
                replacementsDictionary.Add("$databasename$", dlg.DatabaseName);
                replacementsDictionary.Add("$databaseuser$", dlg.DatabaseUser);
                replacementsDictionary.Add("$ormapperclassname$", dlg.ORMapperClassName);
                replacementsDictionary.Add("$ormappermodule$", dlg.ORMapperModule);
                replacementsDictionary.Add("$schema$", dlg.Schema);
                replacementsDictionary.Add("$provider$", dlg.Provider);
            }
            else
            {
                throw new WizardCancelledException("Aborted by user");
            }

            _replacementsDictionary = replacementsDictionary;
        }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:27,代码来源:SolutionWizard.cs

示例9: RunStarted

		public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
		{
			var doc = Helpers.LoadWizardXml(replacementsDictionary);
			var ns = Helpers.WizardNamespace;

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

			var view = new OptionsPageView(model);
			var dialog = new BaseDialog { Content = view, Title = model.Title };
			if (dialog.ShowModal(Helpers.MainWindow))
			{
				foreach (var option in model.Options)
				{
					var selected = option.Selected;
					if (selected != null)
					{
						foreach (var replacement in selected.Replacements)
						{
							if (replacementsDictionary.MatchesCondition(replacement.Condition))
							{
								replacementsDictionary[replacement.Name] = replacement.Content;
							}
						}
					}
				}
			}
			else
				throw new WizardBackoutException();
			
		}
开发者ID:GilbertoBotaro,项目名称:Eto,代码行数:30,代码来源:OptionsWizard.cs

示例10: RunStarted

 public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
 {
     _dte = automationObject as EnvDTE.DTE;
     _viewName = replacementsDictionary["$safeitemname$"];
     _viewModelName = $"{_viewName}ViewModel";
     _templatesDirectory = Path.GetDirectoryName(customParams[0] as string);
 }
开发者ID:ethedy,项目名称:Prism,代码行数:7,代码来源:CreateViewModelForViewWizard.cs

示例11: RunStarted

 public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
 {
     // This is done to trick NuPattern into using the v4 template when unfolding the v5 template.
     // The template is used by NuPattern to identify the toolkit and product elements associated to the template,
     // and there can only one template associated to the application
     base.RunStarted(automationObject, replacementsDictionary, runKind, ApplicationTemplateWorkaroundHelper.ReplaceCustomParameters(customParams));
 }
开发者ID:slamj1,项目名称:ServiceMatrix,代码行数:7,代码来源:InstantiationTemplateCustomWizard.cs

示例12: RunStarted

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams) {

            DTE2 dte = automationObject as DTE2;

            // here we need to show the UI for which file to download
            var form = new DownloadZipWindow();
            var result = form.ShowDialog();

            if (result.HasValue && result.Value) {
                // download the file
                string file = form.DownloadedFile;

                TempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
                if (!Directory.Exists(TempDir)) {
                    Directory.CreateDirectory(TempDir);
                }

                // unpack the file in temp
                ZipFile.ExtractToDirectory(file, TempDir);

                // copy the files to the project directory
                var foo = "bar";
            }

        }
开发者ID:BallisticLingonberries,项目名称:side-waffle,代码行数:25,代码来源:Html5UpProjectWizard.cs

示例13: RunStarted

 // Retrieve global replacement parameters
 public void RunStarted(object automationObject,
     Dictionary<string, string> replacementsDictionary,
     WizardRunKind runKind, object[] customParams)
 {
     // Add custom parameters.
     replacementsDictionary.Add("$saferootprojectname$", RootWizard.GlobalDictionary["$saferootprojectname$"]);
 }
开发者ID:Zamir7,项目名称:urho,代码行数:8,代码来源:ChildWizard.cs

示例14: RunStarted

 public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
 {
     var timestamp = DateTime.Now.ToString("yyyyMMddHHmmss");
       replacementsDictionary["$migrationtimestamp$"] = timestamp;
       replacementsDictionary["$migrationclassname$"] = replacementsDictionary["$safeitemname$"];
       replacementsDictionary["$migrationfilename$"] = String.Format("{0}_{1}.cs", timestamp, replacementsDictionary["$safeitemname$"]);
 }
开发者ID:mgnandt,项目名称:Migration-VS-Template,代码行数:7,代码来源:MigrationWizard.cs

示例15: RunStarted

        public void RunStarted(object automationObject,
          Dictionary<string, string> replacementsDictionary,
          WizardRunKind runKind, object[] customParams)
        {
            _dte = automationObject as EnvDTE80.DTE2;
            _runKind = runKind;

            if(runKind.HasFlag(WizardRunKind.AsNewProject))
            {
                _solutionDir = replacementsDictionary["$solutiondirectory$"];
                _destinationDirectory = replacementsDictionary["$destinationdirectory$"];           
            }         

            try
            {
                // Display a form to the user. The form collects 
                // input for the custom message.
                //inputForm = new UserInputForm();
                //inputForm.ShowDialog();

                //customMessage = inputForm.get_CustomMessage();

                //// Add custom parameters.
                //replacementsDictionary.Add("$custommessage$",
                //    customMessage);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            //Console.Write("Wizard!!!");
        }
开发者ID:JFrogDev,项目名称:msbuild-artifactory-plugin,代码行数:32,代码来源:InitScriptWizard.cs


注:本文中的WizardRunKind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。