本文整理汇总了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());
}
示例2: AddIfWithValueDoesNotAddOnFalse
public void AddIfWithValueDoesNotAddOnFalse()
{
var args = new PrivateArguments();
args.AddIf(false, "testValue");
Assert.AreEqual(0, args.Count);
Assert.AreEqual(string.Empty, args.ToString());
}
示例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());
}
示例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;
}
示例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;
}
示例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);
}
示例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");
}
示例8: AppendRevision
private static void AppendRevision(PrivateArguments buffer, int revision)
{
buffer.AddIf(revision > 0, "--revision ", revision.ToString());
}
示例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);
}
示例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);
}
示例11: AppendRevision
private static void AppendRevision(PrivateArguments buffer, int revision)
{
buffer.AddIf(revision > 0, "--revision ", revision.ToString(CultureInfo.CurrentCulture));
}