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


C# TimeInterval.IntersectsWithExcludingBounds方法代码示例

本文整理汇总了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;

        }
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:39,代码来源:frmResouceScheduling.cs

示例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;
        }
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:15,代码来源:Form1.cs


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