• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# WizardRunKind类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: RunStarted

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            this.ItemTemplateParams = replacementsDictionary;
            _dte = (DTE)automationObject;
            _solution = (Solution4)dte.Solution;

            OnWizardStart(automationObject);
            WizardCancel += new CancelEventHandler(OnWizardCancel);

            if (this.Pages.Count > 0)
            {
                this.CenterToScreen();

                System.Windows.Forms.DialogResult dlgResult = this.ShowDialog();

                if (dlgResult == System.Windows.Forms.DialogResult.OK)
                {
                    OnWizardFinish();

                } else
                if (dlgResult == System.Windows.Forms.DialogResult.Cancel)
                {
                    throw new WizardCancelledException();
                }
         
            }
           
        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:28,代码来源:T4BaseTransformationWizard.cs


示例17: RunStarted

        /// <summary>
        /// Executes when the wizard starts.
        /// </summary>
        public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary,
            WizardRunKind runKind, object[] customParams)
        {
            base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);

            Guard.NotNull(() => replacementsDictionary, replacementsDictionary);
            Guard.NotNull(() => customParams, customParams);

            object contextSolutionName = CallContext.LogicalGetData(SolutionNameKey);
            object contextSafeSolutionName = CallContext.LogicalGetData(SafeSolutionNameKey);

            if (contextSolutionName != null)
            {
                tracer.Verbose(Resources.SolutionNameTemplateWizard_ContextSolutionName, contextSolutionName);

                replacementsDictionary[SolutionNameKey] = (string)contextSolutionName;

                if (contextSafeSolutionName != null)
                {
                    replacementsDictionary[SafeSolutionNameKey] = (string)contextSafeSolutionName;
                }
            }
            else
            {
                tracer.Verbose(Resources.SolutionNameTemplateWizard_NewContextSolution, replacementsDictionary[@"$projectname$"]);

                replacementsDictionary[SolutionNameKey] = replacementsDictionary[@"$projectname$"];
                replacementsDictionary[SafeSolutionNameKey] = replacementsDictionary[@"$safeprojectname$"];

                CallContext.LogicalSetData(SolutionNameKey, replacementsDictionary[SolutionNameKey]);
                CallContext.LogicalSetData(SafeSolutionNameKey, replacementsDictionary[SafeSolutionNameKey]);
            }
        }
开发者ID:NuPattern,项目名称:NuPattern,代码行数:36,代码来源:SolutionNameSetTemplateWizard.cs


示例18: RunStarted

 public void RunStarted(object automationObject,
     Dictionary<string, string> replacementsDictionary,
     WizardRunKind runKind, object[] customParams)
 {
     safeprojectname = replacementsDictionary["$safeprojectname$"];
     globalParameters["$safeprojectname$"] = safeprojectname;
 }
开发者ID:powerxiao,项目名称:mvcTemp,代码行数:7,代码来源:RootWizardImpl.cs


示例19: RunStarted

        public void RunStarted(
            object automationObject,
            Dictionary<string, string> replacementsDictionary,
            WizardRunKind runKind,
            object[] customParams
        ) {
            string winSDKVersion = string.Empty;
            try {
                string keyValue = string.Empty;
                // Attempt to get the installation folder of the Windows 10 SDK
                RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows Kits\Installed Roots");
                if (null != key) {
                    keyValue = (string)key.GetValue("KitsRoot10") + "Include";
                }
                // Get the latest SDK version from the name of the directory in the Include path of the SDK installation.
                if (!string.IsNullOrEmpty(keyValue)) {
                    string dirName = Directory.GetDirectories(keyValue, "10.*").OrderByDescending(x => x).FirstOrDefault();
                    winSDKVersion = Path.GetFileName(dirName);
                }
            } catch(Exception ex) {
                if (ex.IsCriticalException()) {
                    throw;
                }
            }
            
            if(string.IsNullOrEmpty(winSDKVersion)){
                winSDKVersion = "10.0.0.0"; // Default value to put in project file
            }

            replacementsDictionary.Add("$winsdkversion$", winSDKVersion);
            replacementsDictionary.Add("$winsdkminversion$", winSDKVersion);
        }
开发者ID:munyirik,项目名称:PTVS,代码行数:32,代码来源:WindowsSDKWizard.cs


示例20: DeploymentWizardForm

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

            string deploymentFolder = String.Empty;

            string destinationDirectory = replacementsDictionary["$destinationdirectory$"];
            if (destinationDirectory.EndsWith("\\", StringComparison.Ordinal) == false) {
                destinationDirectory = destinationDirectory + "\\";
            }

            string parentFolder = Path.GetDirectoryName(destinationDirectory);

            DeploymentWizardForm wizardForm = new DeploymentWizardForm(parentFolder);
            if (wizardForm.ShowDialog(new WindowOwner((IntPtr)dte.MainWindow.HWnd)) == DialogResult.OK) {
                Uri destinationUri = new Uri(destinationDirectory);
                Uri deploymentUri = new Uri(wizardForm.DeploymentFolder);

                Uri relativeUri = destinationUri.MakeRelativeUri(deploymentUri);

                deploymentFolder = relativeUri.ToString().Replace("/", "\\");
            }

            replacementsDictionary["$deploymentpath$"] = deploymentFolder;
        }
开发者ID:kripa82,项目名称:scriptsharp,代码行数:25,代码来源:ProjectWizard.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WkbByteOrder类代码示例发布时间:2022-05-24
下一篇:
C# WizardNavigationEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap