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


C# CommandLineBuilder.AppendSwitch方法代码示例

本文整理汇总了C#中Microsoft.Build.Utilities.CommandLineBuilder.AppendSwitch方法的典型用法代码示例。如果您正苦于以下问题:C# CommandLineBuilder.AppendSwitch方法的具体用法?C# CommandLineBuilder.AppendSwitch怎么用?C# CommandLineBuilder.AppendSwitch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Build.Utilities.CommandLineBuilder的用法示例。


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

示例1: GenerateCommandLineCommands

 protected override string GenerateCommandLineCommands()
 {
     Log.LogDebugMessage ("MDoc");
     Log.LogDebugMessage ("  RunExport: {0}", RunExport);
     Log.LogDebugMessage ("  TargetAssembly: {0}", TargetAssembly);
     Log.LogDebugMessage ("  References");
     if (References != null)
         foreach (var reference in References)
             Log.LogDebugMessage ("    {0}", reference);
     Log.LogDebugMessage ("  OutputDocDirectory: {0}", OutputDocDirectory);
     if (RunExport) {
         var cmd = new CommandLineBuilder ();
         cmd.AppendSwitch ("--debug");
         cmd.AppendSwitch ("export-msxdoc");
         cmd.AppendSwitchIfNotNull ("-o", Path.ChangeExtension (TargetAssembly, ".xml"));
         cmd.AppendSwitch (OutputDocDirectory);
         return cmd.ToString ();
     } else {
         var refPaths = References.Select (Path.GetDirectoryName).Distinct ();
         var cmd = new CommandLineBuilder ();
         cmd.AppendSwitch ("--debug");
         cmd.AppendSwitch ("update");
         cmd.AppendSwitch ("--delete");
         cmd.AppendSwitchIfNotNull ("-L", Path.GetDirectoryName (TargetAssembly));
         foreach (var rp in refPaths)
             cmd.AppendSwitchIfNotNull ("-L", rp);
         cmd.AppendSwitchIfNotNull ("-o", OutputDocDirectory);
         cmd.AppendSwitch (Path.GetFullPath (TargetAssembly));
         return cmd.ToString ();
     }
 }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:31,代码来源:MDoc.cs

示例2: GenerateCommandLineCommands

        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            if (Source != null)
            {
                foreach (var item in Source)
                {
                    commandLineBuilder.AppendSwitchIfNotNull("-Source ", item.ItemSpec);
                }
            }

            if (FallbackSource != null)
            {
                foreach (var item in FallbackSource)
                {
                    commandLineBuilder.AppendSwitchIfNotNull("-FallbackSource ", item.ItemSpec);
                }
            }

            if (NoCache)
            {
                commandLineBuilder.AppendSwitch("-NoCache");
            }

            if (DisableParallelProcessing)
            {
                commandLineBuilder.AppendSwitch("-DisableParallelProcessing");
            }

            commandLineBuilder.AppendSwitchIfNotNull("-PackageSaveMode ", PackageSaveMode);
        }
开发者ID:CommonBuildToolset,项目名称:CBT.Modules,代码行数:30,代码来源:DownloadCommandBase.cs

示例3: GenerateCommandLineCommands

        /// <summary>
        /// Generates the command line commands.
        /// </summary>
        protected override string GenerateCommandLineCommands()
        {
            ////if (this.Assemblies.Length != 1) {
            ////    throw new NotSupportedException("Exactly 1 assembly for signing is supported.");
            ////}
            CommandLineBuilder args = new CommandLineBuilder();
            args.AppendSwitch("-q");

            if (this.KeyFile != null) {
                args.AppendSwitch("-R");
            } else if (this.KeyContainer != null) {
                args.AppendSwitch("-Rc");
            } else {
                throw new InvalidOperationException("Either KeyFile or KeyContainer must be set.");
            }

            args.AppendFileNameIfNotNull(this.Assemblies[0]);
            if (this.KeyFile != null) {
                args.AppendFileNameIfNotNull(this.KeyFile);
            } else {
                args.AppendFileNameIfNotNull(this.KeyContainer);
            }

            return args.ToString();
        }
开发者ID:jcp-xx,项目名称:dotnetopenid,代码行数:28,代码来源:ReSignDelaySignedAssemblies.cs

示例4: AppendSwitchSimple

 public void AppendSwitchSimple()
 {
     CommandLineBuilder c = new CommandLineBuilder();
     c.AppendSwitch("/a");
     c.AppendSwitch("-b");
     Assert.Equal("/a -b", c.ToString());
 }
开发者ID:cameron314,项目名称:msbuild,代码行数:7,代码来源:CommandLineBuilder_Tests.cs

示例5: GenerateCommandLineCommands

        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder builder = new CommandLineBuilder();
            builder.AppendSwitch("pack");

            if (!File.Exists(this.Target))
            {
                throw new FileNotFoundException(string.Format("The file '{0}' could not be found.", this.Target), this.Target);
            }

            builder.AppendFileNameIfNotNull(this.Target);
            builder.AppendSwitchIfTrue("-Symbols", this.Symbols);
            builder.AppendSwitchIfTrue("-NoDefaultExcludes", this.NoDefaultExcludes);
            builder.AppendSwitchIfTrue("-NoPackageAnalysis", this.NoPackageAnalysis);
            builder.AppendSwitchIfTrue("-ExcludeEmptyDirectories", this.ExcludeEmptyDirectories);
            builder.AppendSwitchIfTrue("-IncludeReferencedProjects", this.IncludeReferencedProjects);
            builder.AppendSwitchIfNotNull("-Version ", this.Version);
            builder.AppendSwitchIfNotNull("-Properties ", this.Properties, ";");
            builder.AppendSwitchIfNotNull("-Exclude ", this.Excluded, ";");
            builder.AppendSwitchIfNotNull("-MinClientVersion ", this.MinClientVersion);
            builder.AppendSwitchIfNotNull("-BasePath ", this.BasePath);
            builder.AppendSwitchIfNotNull("-OutputDirectory ", this.OutputDirectory);
            builder.AppendSwitchIfNotNull("-Verbosity ", this.Verbosity);
            builder.AppendSwitch("-NonInteractive ");
            builder.AppendTextUnquotedIfNotNullOrEmpty(this.CustomSwitches);

            return builder.ToString();
        }
开发者ID:SympaOy,项目名称:NuGet.for.MSBuild,代码行数:28,代码来源:Pack.cs

示例6: GenerateCommandLineCommands

        protected override string GenerateCommandLineCommands()
        {
            var builder = new CommandLineBuilder();

            builder.AppendFileNameIfNotNull(Source);
            if (Source != null)
            {
                OutputRes = Path.ChangeExtension(OutputIL, ".res");
            }

            builder.AppendSwitch("/nobar");
            builder.AppendSwitchIfNotNull("/output=", OutputIL);
            if (Encoding == null || Encoding.StartsWith("uni", StringComparison.InvariantCultureIgnoreCase))
            {
                builder.AppendSwitch("/unicode");
            }
            if (Encoding != null && Encoding.StartsWith("utf", StringComparison.InvariantCultureIgnoreCase))
            {
                builder.AppendSwitch("/utf8");
            }
            builder.AppendSwitchIfNotNull("/item:", Item);

            Log.LogMessage(MessageImportance.High, "Disassembling {0}...", Source);
            return builder.ToString();
        }
开发者ID:AkechiNEET,项目名称:totalcommander-plugin-donnet,代码行数:25,代码来源:ILDasm.cs

示例7: GenerateArguments

        /// <summary>
        /// Generates the arguments.
        /// </summary>
        /// <param name="builder">The builder.</param>
        protected override void GenerateArguments(CommandLineBuilder builder)
        {
            builder.AppendSwitch("--count");

            base.GenerateArguments(builder);

            builder.AppendSwitch(Revision);
        }
开发者ID:464884492,项目名称:msbuildtasks,代码行数:12,代码来源:GitCommits.cs

示例8: GenerateCommandLineCommands

        /// <summary>
        /// Returns a string value containing the command line arguments to pass directly to the executable file.
        /// </summary>
        /// <returns>
        /// A string value containing the command line arguments to pass directly to the executable file.
        /// </returns>
        protected override string GenerateCommandLineCommands()
        {
            var builder = new CommandLineBuilder();

            builder.AppendSwitch("uninstall");
            builder.AppendSwitch(PackageName);

            return builder.ToString();
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:15,代码来源:UninstallApk.cs

示例9: GenerateCommandLineCommands

		protected override string GenerateCommandLineCommands() {
			var args = new CommandLineBuilder();

			args.AppendSwitch("a");
			args.AppendSwitch("--");

			args.AppendFileNameIfNotNull(this.ZipFileName);

			return args.ToString();
		}
开发者ID:hnlshzx,项目名称:DotNetOpenAuth,代码行数:10,代码来源:AddFilesTo7Zip.cs

示例10: GenerateCommandLineCommands

        protected override string GenerateCommandLineCommands()
        {
            var builder = new CommandLineBuilder();
            builder.AppendSwitch(File);

            if (Args != null)
                builder.AppendSwitch(Args);

            return builder.ToString();
        }
开发者ID:pjgrenyer,项目名称:PurpleTube.MSBuild,代码行数:10,代码来源:PythonTaskBase.cs

示例11: GenerateArguments

        /// <summary>
        /// Generates the arguments.
        /// </summary>
        /// <param name="builder">The builder.</param>
        protected override void GenerateArguments(CommandLineBuilder builder)
        {
            builder.AppendSwitch("--verify");

            if (Short)
                builder.AppendSwitch("--short");

            base.GenerateArguments(builder);

            builder.AppendSwitch(Revision);
        }
开发者ID:464884492,项目名称:msbuildtasks,代码行数:15,代码来源:GitVersion.cs

示例12: GenerateCommandLineCommands

		/// <summary>
		/// Generates the command line commands.
		/// </summary>
		protected override string GenerateCommandLineCommands() {
			CommandLineBuilder builder = new CommandLineBuilder();
			builder.AppendSwitch("-q");
			if (this.SkipVerification) {
				builder.AppendSwitch("-Vr");
			} else {
				builder.AppendSwitch("-Vu");
			}

			builder.AppendFileNameIfNotNull(this.AssemblyName + "," + this.PublicKeyToken);
			return builder.ToString();
		}
开发者ID:Balamir,项目名称:DotNetOpenAuth,代码行数:15,代码来源:SignatureVerification.cs

示例13: GenerateCommandLineCommands

		/// <summary>See <see cref="ToolTask.GenerateCommandLineCommands"/>.</summary>
		protected override string GenerateCommandLineCommands()
		{
			CommandLineBuilder commandLineBuilder = new CommandLineBuilder();
			commandLineBuilder.AppendSwitchIfNotNull(this.Uninstall ? "uninstall " : "install ", this.AssemblyName);
			if (this.NoDependencies)
			{
				commandLineBuilder.AppendSwitch("/NoDependencies");
			}
			commandLineBuilder.AppendSwitch("/nologo");
			commandLineBuilder.AppendSwitch("/verbose");
			return commandLineBuilder.ToString();
		}
开发者ID:cjheath,项目名称:NORMA,代码行数:13,代码来源:Ngen.cs

示例14: GenerateCommandLineCommands

        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder cb = new CommandLineBuilder();

            //cb.AppendSwitch("-q");
            cb.AppendSwitch("-nologo");
            cb.AppendSwitch("--");

            cb.AppendFileNamesIfNotNull(Sources, " ");

            return cb.ToString();
        }
开发者ID:riiiqpl,项目名称:sharpsvn,代码行数:12,代码来源:PdbSourceAnnotate.cs

示例15: GenerateCommandLineCommands

        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder builder = new CommandLineBuilder();
            builder.AppendSwitch("spec");

            builder.AppendSwitchIfNotNull("-AssemblyPath ", this.AssemblyPath);
            builder.AppendSwitchIfNotNull("-Verbosity ", this.Verbosity);
            builder.AppendSwitchIfTrue("-Force", this.Force);
            builder.AppendSwitch("-NonInteractive");

            return builder.ToString();
        }
开发者ID:SympaOy,项目名称:NuGet.for.MSBuild,代码行数:12,代码来源:Spec.cs


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