本文整理汇总了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;
}
示例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>();
}
示例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;
}
示例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;
}
示例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;
}