本文整理汇总了C#中IDateTime.GreaterThanOrEqual方法的典型用法代码示例。如果您正苦于以下问题:C# IDateTime.GreaterThanOrEqual方法的具体用法?C# IDateTime.GreaterThanOrEqual怎么用?C# IDateTime.GreaterThanOrEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDateTime
的用法示例。
在下文中一共展示了IDateTime.GreaterThanOrEqual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsActive
/// <summary>
/// Returns 'True' if the todo item is Active as of <paramref name="currDt"/>.
/// An item is Active if it requires action of some sort.
/// </summary>
/// <param name="currDt">The date and time to test.</param>
/// <returns>True if the item is Active as of <paramref name="currDt"/>, False otherwise.</returns>
virtual public bool IsActive(IDateTime currDt)
{
if (DTStart == null)
return !IsCompleted(currDt) && !IsCancelled();
else if (currDt.GreaterThanOrEqual(DTStart))
return !IsCompleted(currDt) && !IsCancelled();
else return false;
}
示例2: IsCompleted
/// <summary>
/// Use this method to determine if a todo item has been completed.
/// This takes into account recurrence items and the previous date
/// of completion, if any.
/// <note>
/// This method evaluates the recurrence pattern for this TODO
/// as necessary to ensure all relevant information is taken
/// into account to give the most accurate result possible.
/// </note>
/// </summary>
/// <param name="DateTime">The date and time to test.</param>
/// <returns>True if the todo item has been completed</returns>
virtual public bool IsCompleted(IDateTime currDt)
{
if (Status == TodoStatus.Completed)
{
if (Completed == null ||
Completed.GreaterThan(currDt))
return true;
// Evaluate to the previous occurrence.
m_Evaluator.EvaluateToPreviousOccurrence(Completed, currDt);
foreach (Period p in m_Evaluator.Periods)
{
if (p.StartTime.GreaterThan(Completed) && // The item has recurred after it was completed
currDt.GreaterThanOrEqual(p.StartTime)) // and the current date is after or on the recurrence date.
return false;
}
return true;
}
return false;
}