本文整理汇总了C#中TimeInterval.IntersectsWithExcludingBounds方法的典型用法代码示例。如果您正苦于以下问题:C# TimeInterval.IntersectsWithExcludingBounds方法的具体用法?C# TimeInterval.IntersectsWithExcludingBounds怎么用?C# TimeInterval.IntersectsWithExcludingBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeInterval
的用法示例。
在下文中一共展示了TimeInterval.IntersectsWithExcludingBounds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateIntersection
/// <summary>
/// Valida la overlaping de horarios
/// Si todo esta bien returna True
/// </summary>
/// <param name="pResourceSchedulingBE"></param>
/// <returns></returns>
Boolean ValidateIntersection(ResourceSchedulingBE pResourceSchedulingBE)
{
TimeInterval interva1 = null;
TimeInterval interva2 = null;
interva2 = new TimeInterval(
Fwk.HelperFunctions.DateFunctions.BeginningOfTimes.AddHours(pResourceSchedulingBE.TimeStart.TotalHours),
Fwk.HelperFunctions.DateFunctions.BeginningOfTimes.AddHours(pResourceSchedulingBE.TimeEnd.TotalHours));
foreach (ResourceSchedulingBE r in ResourceSchedulingBEList)
{
//Si no hay dias en comun no hay problema
if (!r.HasDaysInCommon(pResourceSchedulingBE.WeekDays_BinArray))
{
return true;
}
//Si tienen dias en comun hay que verificar que no se overlapen los horarios
interva1 = new TimeInterval(
Fwk.HelperFunctions.DateFunctions.BeginningOfTimes.AddHours(r.TimeStart.TotalHours),
Fwk.HelperFunctions.DateFunctions.BeginningOfTimes.AddHours(r.TimeEnd.TotalHours));
if (interva1.IntersectsWithExcludingBounds(interva2))
return false;
//bool val3 = interva1.IntersectsWith(interva2);
}
return true;
}
示例2: IsHoliday
private bool IsHoliday(TimeInterval interval)
{
for (int i = 0; i < Holidays.Count; i++)
{
Holiday holiday = Holidays[i] as Holiday;
if (holiday != null)
{
TimeInterval holidayInterval = new TimeInterval(holiday.Date, TimeSpan.FromDays(1));
if (holidayInterval.IntersectsWithExcludingBounds(interval))
return true;
}
}
return false;
}