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


C# TimeLine.IsTimeLineWithin方法代码示例

本文整理汇总了C#中My24HourTimerWPF.TimeLine.IsTimeLineWithin方法的典型用法代码示例。如果您正苦于以下问题:C# TimeLine.IsTimeLineWithin方法的具体用法?C# TimeLine.IsTimeLineWithin怎么用?C# TimeLine.IsTimeLineWithin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在My24HourTimerWPF.TimeLine的用法示例。


在下文中一共展示了TimeLine.IsTimeLineWithin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: shiftEvent

        virtual public bool shiftEvent(TimeSpan ChangeInTime, SubCalendarEvent[] UpdatedSubCalEvents)
        {
            TimeLine UpdatedTimeLine = new TimeLine(this.Start+ChangeInTime,this.End+ChangeInTime);
            
            foreach (SubCalendarEvent eachSubCalendarEvent in UpdatedSubCalEvents)
            { 
                if(!(UpdatedTimeLine.IsTimeLineWithin(eachSubCalendarEvent.RangeTimeLine)))
                {
                    return false;
                }
            }
            StartDateTime = StartDateTime + ChangeInTime;
            EndDateTime = EndDateTime + ChangeInTime;
            ArrayOfSubEvents = UpdatedSubCalEvents.ToArray();

            return true;
        }
开发者ID:jerbio,项目名称:WagTapWeb,代码行数:17,代码来源:CalendarEvent.cs

示例2: getOnlyPertinentTimeFrame

        public List<TimeLine> getOnlyPertinentTimeFrame(TimeLine[] ArraytOfFreeSpots, TimeLine myTimeLine)
        {
            /*
             * Name: Jerome Biotidara
             * Description: Function only takes a TImeLine and Array Of TimeLine FreeSpots. It returns a List Of TimeLine In whcih each elements  exist within the range of TimeLine
             */
            List<TimeLine> PertinentTimeLine = new List<TimeLine>();
            List<TimeLine> OutLiers = new List<TimeLine>();

            foreach (TimeLine MyFreeTimeLine in ArraytOfFreeSpots)
            {
                if (myTimeLine.IsTimeLineWithin(MyFreeTimeLine))
                {
                    PertinentTimeLine.Add(MyFreeTimeLine);
                }
                else
                {
                    OutLiers.Add(MyFreeTimeLine);
                }
            }

            foreach (TimeLine Outlier in OutLiers)//this can be embedded in the preceeding foreach loop above in the else branch
            {
                if (myTimeLine.IsDateTimeWithin(Outlier.Start))
                {
                    PertinentTimeLine.Add(new TimeLine(Outlier.Start, myTimeLine.End));
                }
                else
                {
                    if (myTimeLine.IsDateTimeWithin(Outlier.End))
                    {
                        PertinentTimeLine.Add(new TimeLine(myTimeLine.Start, Outlier.End));
                    }
                    else
                    {
                        if (Outlier.IsTimeLineWithin(myTimeLine))
                        {
                            PertinentTimeLine.Add(Outlier);
                        }
                    }
                }
            }

            return PertinentTimeLine;



            //return new List<TimeLine>();
        }
开发者ID:jerbio,项目名称:WagTapWeb,代码行数:49,代码来源:Schedule.cs

示例3: getBusyTimeLineWithinSlots

 public List<BusyTimeLine> getBusyTimeLineWithinSlots(TimeLine MyTimeLineRange)
 {
     List<BusyTimeLine> ActiveSlots = new List<BusyTimeLine>();
     foreach (BusyTimeLine MyBusyTimeline in ActiveTimeSlots)
     {
         if (MyTimeLineRange.IsTimeLineWithin(MyBusyTimeline))
         {
             ActiveSlots.Add(MyBusyTimeline);
         }
     }
     return ActiveSlots;
 }
开发者ID:jerbio,项目名称:My24HourTimerWPF,代码行数:12,代码来源:MainWindow.xaml.cs.old.cs

示例4: getEdgeElements

        List<BusyTimeLine>[] getEdgeElements(TimeLine MyRangeOfTimeLine, BusyTimeLine[] ArrayOfTInterferringime)
        {
            List<BusyTimeLine> ListOfEdgeElements = new List<BusyTimeLine>();
            List<BusyTimeLine> StartEdge = new List<BusyTimeLine>();
            List<BusyTimeLine> EndEdge = new List<BusyTimeLine>();
            int i=0;
            for (; i < ArrayOfTInterferringime.Length; i++)
            {
                if (!MyRangeOfTimeLine.IsTimeLineWithin(ArrayOfTInterferringime[i]))
                {
                    ListOfEdgeElements.Add(ArrayOfTInterferringime[i]);
                }
            }

            i = 0;

            for (; i < ListOfEdgeElements.Count; i++)
            {
                if (ListOfEdgeElements[i].Start < MyRangeOfTimeLine.Start)
                {
                    StartEdge.Add(ListOfEdgeElements[i]);
                }
                else
                {
                    EndEdge.Add(ListOfEdgeElements[i]);
                }
            }

            List<BusyTimeLine>[] StartAndEndEdgeList = new List<BusyTimeLine>[2];
            StartAndEndEdgeList[0] = StartEdge;
            StartAndEndEdgeList[1] = EndEdge;
            return StartAndEndEdgeList;
        }
开发者ID:jerbio,项目名称:My24HourTimerWPF,代码行数:33,代码来源:MainWindow.xaml.cs.old.cs

示例5: shiftEvent

        virtual public bool shiftEvent(TimeSpan ChangeInTime, SubCalendarEvent[] UpdatedSubCalEvents)
        {
            TimeLine UpdatedTimeLine = new TimeLine(this.Start+ChangeInTime,this.End+ChangeInTime);
            bool retValue = true;
            foreach (SubCalendarEvent eachSubCalendarEvent in UpdatedSubCalEvents)//test if the updated locations for the subevents fall within the shifted timeline
            { 
                if(!(UpdatedTimeLine.IsTimeLineWithin(eachSubCalendarEvent.RangeTimeLine)))
                {
                    return false;
                }
            }



            
            foreach (SubCalendarEvent eachSubCalendarEvent in UpdatedSubCalEvents)
            {
                if (!updateSubEvent(eachSubCalendarEvent.SubEvent_ID, eachSubCalendarEvent))
                {
                    retValue = false;//there was some error updating the subevent
                }
            }
            

            StartDateTime = StartDateTime + ChangeInTime;
            EndDateTime = EndDateTime + ChangeInTime;

            return retValue;
        }
开发者ID:jerbio,项目名称:My24HourTimerWPF,代码行数:29,代码来源:CalendarEvent.cs


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