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


C# PrivateArguments.AddIf方法代码示例

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


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

示例1: AddIfWithValueAddsOnTrue

 public void AddIfWithValueAddsOnTrue()
 {
     var args = new PrivateArguments();
     args.AddIf(true, "testValue");
     Assert.AreEqual(1, args.Count);
     Assert.AreEqual("testValue", args.ToString());
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:7,代码来源:PrivateArgumentsTests.cs

示例2: AddIfWithValueDoesNotAddOnFalse

 public void AddIfWithValueDoesNotAddOnFalse()
 {
     var args = new PrivateArguments();
     args.AddIf(false, "testValue");
     Assert.AreEqual(0, args.Count);
     Assert.AreEqual(string.Empty, args.ToString());
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:7,代码来源:PrivateArgumentsTests.cs

示例3: AddIfWithAutoQuoteValueAddsOnTrue

 public void AddIfWithAutoQuoteValueAddsOnTrue()
 {
     var args = new PrivateArguments();
     args.AddIf(true, "pre=", "test Value", true);
     Assert.AreEqual(1, args.Count);
     Assert.AreEqual("pre=\"test Value\"", args.ToString());
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:7,代码来源:PrivateArgumentsTests.cs

示例4: LabelProcessInfoArgs

 private PrivateArguments LabelProcessInfoArgs(string label, string oldLabel)
 {
     var builder = new PrivateArguments();
     builder.Add("label ", Project, true);
     builder.Add("-L", label);
     builder.AddIf(!string.IsNullOrEmpty(oldLabel), "-VL", oldLabel);
     AppendUsernameAndPassword(builder);
     builder.Add("-I-Y");
     return builder;
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:10,代码来源:Vss.cs

示例5: GetSourceArgs

 private PrivateArguments GetSourceArgs(IIntegrationResult result)
 {
     var builder = new PrivateArguments();
     builder.Add("get ", Project + "/*?*", true);
     builder.Add(RecursiveCommandLineOption);
     builder.AddIf(ApplyLabel, "-VL", tempLabel);
     builder.AddIf(!AlwaysGetLatest, "-Vd", locale.FormatCommandDate(result.StartTime));
     AppendUsernameAndPassword(builder);
     builder.Add("-I-N -W -GF- -GTM");
     builder.AddIf(CleanCopy, "-GWR");
     return builder;
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:12,代码来源:Vss.cs

示例6: PropGetProcessInfo

 private ProcessInfo PropGetProcessInfo(IIntegrationResult result)
 {
     var buffer = new PrivateArguments("propget");
     buffer.AddIf(CheckExternalsRecursive, "-R");
     AppendCommonSwitches(buffer);
     buffer.Add("svn:externals");
     buffer.Add(TrunkUrl);
     return NewProcessInfo(buffer, result);
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:9,代码来源:Svn.cs

示例7: AppendCommonSwitches

 private void AppendCommonSwitches(PrivateArguments buffer, bool isExternal)
 {
     if ((this.AuthCaching != AuthCachingMode.Always) && (!isExternal || (this.AuthCaching == AuthCachingMode.None)))
     {
         buffer.AddIf(!string.IsNullOrEmpty(this.Username), "--username ", this.Username, true);
         buffer.AddIf(this.Password != null, "--password ", this.Password, true);
         buffer.Add("--no-auth-cache");
     }
     buffer.Add("--non-interactive");
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:10,代码来源:Svn.cs

示例8: AppendRevision

 private static void AppendRevision(PrivateArguments buffer, int revision)
 {
     buffer.AddIf(revision > 0, "--revision ", revision.ToString());
 }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:4,代码来源:Svn.cs

示例9: CreateGetProcess

        /// <summary>
        /// Creates the get process.	
        /// </summary>
        /// <param name="filename">The filename.</param>
        /// <returns></returns>
        /// <remarks></remarks>
		public ProcessInfo CreateGetProcess(string filename)
		{
			// @"getlatest ""{0}"" -s ""{1}"" -d ""{2}"" -u ""{3}"" -p ""{4}"" -localpath ""{5}"" -overwritewritable replace -overwritecheckedout replace -response:GetLatest.PathInvalid y -response:GetLatest.Writable y -response:GetLatest.CheckedOut y"
			var args = new PrivateArguments();
            args.Add("getlatest ", filename, true);
            args.Add("-s ", Server, true);
            args.Add("-d ", Database, true);
            args.Add("-u ", Username, true);
            args.Add("-p ", Password, true);
            args.AddIf(!string.IsNullOrEmpty(WorkingDirectory), "-localpath ", WorkingDirectory, true);
            args.Add("-overwritewritable replace -overwritecheckedout replace -response:GetLatest.PathInvalid y -response:GetLatest.Writable y -response:GetLatest.CheckedOut y");
            return new ProcessInfo(Executable, args);
		}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:19,代码来源:Alienbrain.cs

示例10: AddCommonOptionalArguments

        /// <summary>
        /// Adds the common optional arguments.	
        /// </summary>
        /// <param name="builder">The builder.</param>
        /// <remarks></remarks>
        protected void AddCommonOptionalArguments(PrivateArguments builder)
		{
			builder.AddIf(!string.IsNullOrEmpty(_shim.Host), "-host ", _shim.Host);
            builder.AddIf(!string.IsNullOrEmpty(_shim.Username), "-user ", _shim.Username);
            builder.AddIf(_shim.Password != null, "-password ", _shim.Password);
            builder.AddIf(!string.IsNullOrEmpty(_shim.Repository), "-repository ", _shim.Repository, true);
			builder.AddIf(_shim.Ssl, "-ssl");

			builder.AddIf(!string.IsNullOrEmpty(_shim.proxyServer), "-proxyserver ", _shim.proxyServer);
            builder.AddIf(!string.IsNullOrEmpty(_shim.proxyPort), "-proxyport ", _shim.proxyPort);
            builder.AddIf(!string.IsNullOrEmpty(_shim.proxyUser), "-proxyuser ", _shim.proxyUser);
            builder.AddIf(!string.IsNullOrEmpty(_shim.proxyPassword), "-proxypassword ", _shim.proxyPassword);
            builder.AddIf(!string.IsNullOrEmpty(_shim.proxyDomain), "-proxydomain ", _shim.proxyDomain);

			builder.Add(_shim.otherVaultArguments);
		}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:21,代码来源:Vault3.cs

示例11: AppendRevision

 private static void AppendRevision(PrivateArguments buffer, int revision)
 {
     buffer.AddIf(revision > 0, "--revision ", revision.ToString(CultureInfo.CurrentCulture));
 }
开发者ID:RubenWillems,项目名称:CruiseControl.NET,代码行数:4,代码来源:Svn.cs


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