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


C# CommandLineBuilder.AppendSwitchIfNotNull方法代码示例

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


在下文中一共展示了CommandLineBuilder.AppendSwitchIfNotNull方法的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>
        /// Construct the command line from the task properties by using the CommandLineBuilder
        /// </summary>
        /// <returns></returns>
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder builder = new CommandLineBuilder();

            foreach(ITaskItem iti in this._sources)
            {
                builder.AppendFileNameIfNotNull(iti);
            }

            if (this._configurationFile != null)
            {
                builder.AppendSwitchIfNotNull("/config:", new string[] {this._configurationFile}, ":");
            }

            if (this._filename != null)
            {
                builder.AppendSwitchIfNotNull("/fileName:", new string[] {this._filename}, ":");
            }

            // Log a High importance message stating the file that we are assembling
            Log.LogMessage(MessageImportance.High, "Assembling {0}", this._sources);

            // We have all of our switches added, return the commandline as a string
            return builder.ToString();
        }
开发者ID:pusp,项目名称:o2platform,代码行数:29,代码来源:LinqToXsdTask.cs

示例4: 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()
 {
     CommandLineBuilder builder = new CommandLineBuilder();
     builder.AppendSwitchIfNotNull("/d:", ChmDirectory);
     builder.AppendSwitchIfNotNull("/l:", LanguageId ?? "1033");
     return builder.ToString();
 }
开发者ID:464884492,项目名称:msbuildtasks,代码行数:13,代码来源:DBCSFix.cs

示例5: 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

示例6: GenerateCommandLineCommands

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

            builder.AppendSwitchIfNotNull("/source:", SourceDirectory);
            builder.AppendSwitchIfNotNull("/target:", TargetDirectory);
            builder.AppendSwitchIfNotNull("/output:", OutputUpdateFile);

            return builder.ToString();
        }
开发者ID:kevinobee,项目名称:Sitecore-Courier,代码行数:10,代码来源:SitecoreCourier.cs

示例7: 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

示例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("update");
            builder.AppendFileNameIfNotNull(Package);
            builder.AppendSwitchIfNotNull("-Version ", Version);
            builder.AppendSwitchIfNotNull("-Source ", Source);
            builder.AppendSwitchIfNotNull("-OutputDirectory ", OutputDirectory);
            builder.AppendSwitchIfNotNull("-RepositoryPath ", RepositoryPath);
            builder.AppendSwitchIfNotNull("-OutputDirectory ", OutputDirectory);
            builder.AppendSwitchIfNotNull("-FileConflictAction ", FileConflictAction);
            builder.AppendSwitchIfNotNull("-Verbosity ", Verbosity);
            builder.AppendSwitchIfNotNull("-ConfigFile ", ConfigFile);

            if (Prerelease)
                builder.AppendSwitch("-Prerelease");
            if (Safe)
                builder.AppendSwitch("-Safe");
            if (Self)
                builder.AppendSwitch("-Self");

            builder.AppendSwitch("-NonInteractive");

            return builder.ToString();
        }
开发者ID:KGuetter,项目名称:msbuildtasks,代码行数:31,代码来源:NuGetUpdate.cs

示例9: GenerateCommandLineCommands

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

            builder.AppendFileNameIfNotNull(this.PackagePath);
            builder.AppendSwitchIfNotNull("-ApiKey ", this.ApiKey);
            builder.AppendSwitchIfNotNull("-ConfigFile ", this.ConfigFile);
            builder.AppendSwitchIfNotNull("-Source ", this.Source);
            builder.AppendSwitchIfNotNull("-Verbosity ", this.Verbosity);
            builder.AppendSwitch("-NonInteractive");

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

示例10: CreateCommandLine

        protected virtual CommandLineBuilder CreateCommandLine()
        {
            var cmd = new CommandLineBuilder ();

            cmd.AppendSwitch (Command);
            if (Verbose) {
                cmd.AppendSwitch ("-V");
            }
            cmd.AppendSwitchIfNotNull ("-alias ", KeyAlias);
            cmd.AppendSwitchIfNotNull ("-storepass ", StorePass);
            cmd.AppendSwitchIfNotNull ("-keypass ", KeyPass);
            cmd.AppendSwitchIfNotNull ("-keystore ", KeyStore);
            return cmd;
        }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:14,代码来源:KeyTool.cs

示例11: GenerateCommandLineCommands

        protected override string GenerateCommandLineCommands()
        {
            var builder = new CommandLineBuilder();
            builder.AppendSwitch("pack");
            builder.AppendFileNameIfNotNull(Package);
            builder.AppendSwitchIfNotNull("-Version ", Version);
            builder.AppendSwitchIfNotNull("-BasePath ", BasePath);
            builder.AppendSwitchIfNotNull("-OutputDirectory ", OutputDirectory);

            if (Symbols)
              builder.AppendSwitch("-symbols");

            return builder.ToString();
        }
开发者ID:chenzuo,项目名称:nquery,代码行数:14,代码来源:NuGetPack.cs

示例12: GenerateCommandLineCommands

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

			builder.AppendFileNameIfNotNull(PackagePath);
			builder.AppendSwitch("-NonInteractive");
			builder.AppendSwitchIfNotNull("-Source ", Source);
			builder.AppendSwitchIfNotNull("-ApiKey ", ApiKey);
			builder.AppendSwitchIfNotNull("-Verbosity ", Verbosity);
			builder.AppendSwitchIfNotNull("-ConfigFile ", ConfigFile);
			builder.AppendSwitchIfNotNullOrEmpty(PushArguments);

			return builder.ToString();
		}
开发者ID:DarylWright,项目名称:OvermanGroup.NuGet.Packager,代码行数:15,代码来源:PublishNuGetPackage.cs

示例13: 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("delete");
            builder.AppendFileNameIfNotNull(Package);
            builder.AppendFileNameIfNotNull(Version);
            builder.AppendSwitchIfNotNull("-ApiKey ", ApiKey);
            builder.AppendSwitchIfNotNull("-Source ", Source);
            builder.AppendSwitchIfNotNull("-Verbosity ", Verbosity);
            builder.AppendSwitchIfNotNull("-ConfigFile ", ConfigFile);

            builder.AppendSwitch("-NonInteractive");

            return builder.ToString();
        }
开发者ID:KGuetter,项目名称:msbuildtasks,代码行数:21,代码来源:NuGetDelete.cs

示例14: 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()
 {
     CommandLineBuilder builder = new CommandLineBuilder();
     builder.AppendSwitchIfNotNull("/config:", ConfigFile);
     builder.AppendFileNameIfNotNull(ManifestFile);
     return builder.ToString();
 }
开发者ID:464884492,项目名称:msbuildtasks,代码行数:13,代码来源:BuildAssembler.cs

示例15: GenerateCommandLineCommands

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

            GenerateCommandLineCommands(commandLineBuilder);

            commandLineBuilder.AppendSwitchIfNotNull("-ConfigFile ", ConfigFile);

            if (_commandVerbosity != CommandVerbosity.None)
            {
                commandLineBuilder.AppendSwitchIfNotNull("-Verbosity ", _commandVerbosity.ToString());
            }

            commandLineBuilder.AppendSwitchIfTrue("-NonInteractive", NonInteractive);

            return commandLineBuilder.ToString();
        }
开发者ID:CommonBuildToolset,项目名称:CBT.Modules,代码行数:17,代码来源:CommandBase.cs


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