當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。