本文整理汇总了C#中IIntegrationResult.IsInitial方法的典型用法代码示例。如果您正苦于以下问题:C# IIntegrationResult.IsInitial方法的具体用法?C# IIntegrationResult.IsInitial怎么用?C# IIntegrationResult.IsInitial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IIntegrationResult
的用法示例。
在下文中一共展示了IIntegrationResult.IsInitial方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Evaluate
/// <summary>
/// Performs the actual evaluation.
/// </summary>
/// <param name="result">The result.</param>
/// <returns>
/// <c>true</c> if the condition is true; <c>false</c> otherwise.
/// </returns>
protected override bool Evaluate(IIntegrationResult result)
{
LogDescriptionOrMessage("Checking last build status - matching to " + Status);
if (result.IsInitial())
{
// There is no previous build - assume that the condition fails
return false;
}
return Status == result.LastBuildStatus;
}
示例2: Generate
public string Generate(IIntegrationResult previousResult)
{
if (previousResult == null || previousResult.IsInitial())
{
return LabelPrefix + INITIAL_LABEL;
}
else if (ShouldIncrementLabel(previousResult))
{
return LabelPrefix + IncrementLabel(previousResult.Label);
}
else
{
return previousResult.Label;
}
}
示例3: Evaluate
/// <summary>
/// Performs the actual evaluation.
/// </summary>
/// <param name="result">The result.</param>
/// <returns>
/// <c>true</c> if the condition is true; <c>false</c> otherwise.
/// </returns>
protected override bool Evaluate(IIntegrationResult result)
{
this.LogDescriptionOrMessage(
"Checking last build time - checking build was at least " +
(this.Time.Millis/1000) + "s ago");
if (result.IsInitial())
{
// There is no previous build - assume that the condition passes
return true;
}
var checkTime = DateTime.Now.AddMilliseconds(-this.Time.Millis);
var isTrue = checkTime > result.LastIntegration.StartTime;
return isTrue;
}
示例4: Generate
public string Generate(IIntegrationResult previousResult)
{
if (previousResult == null || previousResult.Label == null || previousResult.IsInitial())
{
return NewLabel(InitialLabel);
}
else if (previousResult.Status == IntegrationStatus.Success)
{
return NewLabel(IncrementLabel(previousResult.Label));
}
else
{
return previousResult.Label;
}
}
示例5: Generate
public string Generate(IIntegrationResult resultFromLastBuild)
{
DateTime now = dateTimeProvider.Now;
Version version = resultFromLastBuild.IsInitial()
? MakeDefaultVersion(now) : new Version(resultFromLastBuild.LastSuccessfulIntegrationLabel);
int revision = version.Revision;
if (now.Year == version.Major && now.Month == version.Minor && now.Day == version.Build)
{
revision += 1;
}
else
{
revision = 1;
}
return new Version(now.Year, now.Month, now.Day, revision).ToString();
}