本文整理汇总了C#中My24HourTimerWPF.TimeLine类的典型用法代码示例。如果您正苦于以下问题:C# TimeLine类的具体用法?C# TimeLine怎么用?C# TimeLine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimeLine类属于My24HourTimerWPF命名空间,在下文中一共展示了TimeLine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Schedule
public Schedule()
{
AllEventDictionary = getAllCalendarFromXml();
myCalendar = new ThirdPartyCalendarControl[1];
myCalendar[0] = new ThirdPartyCalendarControl(ThirdPartyCalendarControl.CalendarTool.Outlook);
CompleteSchedule = getTimeLine();
}
示例2: InListOutOfList
public InListOutOfList(List<SubCalendarEvent> FullList, List<List<List<SubCalendarEvent>>> AllMyList, List<TimeLine> MyFreeSpots)
{
DictData_TimeLine = new Dictionary<List<TimeLine>, List<SubCalendarEvent>>();
foreach (List<List<SubCalendarEvent>> ListToCheck in AllMyList)
{
List<SubCalendarEvent> TotalList = new List<SubCalendarEvent>();
int i = 0;
List<TimeLine> timeLineEntry = new List<TimeLine>();
foreach (List<SubCalendarEvent> myList in ListToCheck)
{
TimeLine myTimeLine = new TimeLine(MyFreeSpots[i].Start, MyFreeSpots[i].End);
TotalList.AddRange(myList);
TimeSpan TotalTimeSpan = new TimeSpan(0);
foreach (SubCalendarEvent mySubEvent in myList)
{
TotalTimeSpan=TotalTimeSpan.Add(mySubEvent.ActiveSlot.BusyTimeSpan);
}
BusyTimeLine EffectivebusySlot = new BusyTimeLine("1000000_1000001", MyFreeSpots[i].Start, MyFreeSpots[i].Start.Add(TotalTimeSpan));
myTimeLine.AddBusySlots(EffectivebusySlot);
timeLineEntry.Add(myTimeLine);
i++;
}
DictData_TimeLine.Add(timeLineEntry, Utility.NotInList_NoEffect(FullList, TotalList));
}
}
示例3: EfficientTimeLine
public EfficientTimeLine(TimeLine RestrictiveTimeLine, Dictionary<SubCalendarEvent, TimeLine> SubCalEvent_RestrictingTimeLine)
{
List<SubCalendarEvent> SubCalEventRestricted = SubCalEvent_RestrictingTimeLine.Keys.ToList();
SubCalEventRestricted=SubCalEventRestricted.OrderBy(obj => obj.End).ToList();
Dictionary<long, List<SubCalendarEvent>> Dict_DeadlineAndClashingDeadlineSubCalEvents = new Dictionary<long, List<SubCalendarEvent>>();
foreach (SubCalendarEvent MySubCalEvent in SubCalEventRestricted)
{
if (Dict_DeadlineAndClashingDeadlineSubCalEvents.ContainsKey(MySubCalEvent.End.Ticks))
{
Dict_DeadlineAndClashingDeadlineSubCalEvents[MySubCalEvent.End.Ticks].Add(MySubCalEvent);
}
else
{
Dict_DeadlineAndClashingDeadlineSubCalEvents.Add(MySubCalEvent.End.Ticks,new List<SubCalendarEvent>());
Dict_DeadlineAndClashingDeadlineSubCalEvents[MySubCalEvent.End.Ticks].Add(MySubCalEvent);
}
}
SubCalEventRestricted = new List<SubCalendarEvent>();
foreach (long DeadLine in Dict_DeadlineAndClashingDeadlineSubCalEvents.Keys.ToArray())
{
Dict_DeadlineAndClashingDeadlineSubCalEvents[DeadLine] = Dict_DeadlineAndClashingDeadlineSubCalEvents[DeadLine].OrderBy(obj => obj.Start).ToList();
SubCalEventRestricted.AddRange(Dict_DeadlineAndClashingDeadlineSubCalEvents[DeadLine]);
}
Dictionary<SubCalendarEvent, TimeLine> SubCalEvent_RestrictingTimeLine_Sorted = new Dictionary<SubCalendarEvent, TimeLine>();
foreach (SubCalendarEvent MySubCalEvent in SubCalEventRestricted)
{
SubCalEvent_RestrictingTimeLine_Sorted.Add(MySubCalEvent, SubCalEvent_RestrictingTimeLine[MySubCalEvent]);
}
BuildIndex(RestrictiveTimeLine, SubCalEvent_RestrictingTimeLine_Sorted);
RestrictingTimeLine = RestrictiveTimeLine;
}
示例4: BuildIndex
private void BuildIndex(TimeLine RestrictingTimeLine, Dictionary<SubCalendarEvent, TimeLine> SubCalEvent_RestrictingTimeLine)
{
int Index = 0;
SubCalendarEvent[] ListOfSortedSubCalEvents = SubCalEvent_RestrictingTimeLine.Keys.ToArray();
TimeLineData.Add(Index, new Tuple<DateTime,TimeLine,DateTime,TimeLine>(RestrictingTimeLine.Start,new TimeLine(RestrictingTimeLine.Start,RestrictingTimeLine.Start), ListOfSortedSubCalEvents[Index].Start,SubCalEvent_RestrictingTimeLine[ListOfSortedSubCalEvents[Index]]));
for (; Index < ListOfSortedSubCalEvents.Length-1; Index++)
{
TimeLineData.Add(Index+1, new Tuple<DateTime, TimeLine, DateTime, TimeLine>(ListOfSortedSubCalEvents[Index].End, SubCalEvent_RestrictingTimeLine[ListOfSortedSubCalEvents[Index]], ListOfSortedSubCalEvents[Index+1].Start, SubCalEvent_RestrictingTimeLine[ListOfSortedSubCalEvents[Index+1]]));
}
TimeLineData.Add(Index + 1, new Tuple<DateTime, TimeLine, DateTime, TimeLine>(ListOfSortedSubCalEvents[Index].End, SubCalEvent_RestrictingTimeLine[ListOfSortedSubCalEvents[Index]], RestrictingTimeLine.End,new TimeLine(RestrictingTimeLine.End,RestrictingTimeLine.End) ));
}
示例5: SubCalendarEvent
public SubCalendarEvent(string MySubEventID, DateTime EventStart, DateTime EventDeadline, BusyTimeLine SubEventBusy, bool Rigid, bool Enabled, EventDisplay UiParam, MiscData Notes, bool completeFlag, Location EventLocation = null, TimeLine RangeOfSubCalEvent = null)
{
CalendarEventRange = RangeOfSubCalEvent;
SubEventID = new EventID(MySubEventID.Split('_'));
StartDateTime = EventStart;
EndDateTime = EventDeadline;
EventDuration = SubEventBusy.TimelineSpan;
BusyFrame = SubEventBusy;
RigidSchedule = Rigid;
this.Enabled = Enabled;
this.EventLocation = EventLocation;
UiParams = UiParam;
DataBlob = Notes;
Complete = completeFlag;
}
示例6: ClumpSubCalendarEvent
public ClumpSubCalendarEvent(List<SubCalendarEvent> Appendables, TimeLine BoundaryTimeLine)
{
Appendables=Appendables.OrderBy(obj => obj.getCalendarEventRange.End).ToList();
SubCalendarEvent RelativeSubEvent = Appendables[0];
Appendables.Remove(RelativeSubEvent);
ClumpSubCalendarEvent myThis = new ClumpSubCalendarEvent(RelativeSubEvent, Appendables, BoundaryTimeLine.CreateCopy());
SubCalEventsOverLapWithBase = myThis.SubCalEventsOverLapWithBase;
//List<SubCalendarEvent> NonOverLapping;
BaseEvent= myThis.BaseEvent;
this.BoundaryTimeLine =myThis.BoundaryTimeLine;
//List<SubCalendarEvent> BaseClump;
//List<ClumpSubCalendarEvent> NonOverLapping_Clump;
BreakOffClump= myThis.BreakOffClump;
ClumpedResults= myThis.ClumpedResults;
BaseReferenceStartTime = myThis.BaseReferenceStartTime;
}
示例7: CalendarEvent
public CalendarEvent(CustomErrors Error)
{
EventDuration = new TimeSpan();
CalendarEventName = "";
StartDateTime = new DateTime();
EndDateTime = new DateTime();
EventPreDeadline = new TimeSpan();
PrepTime = new TimeSpan();
Priority = 0;
RepetitionFlag = false;
EventRepetition = new Repetition();
RigidSchedule = false;
Splits = 1;
LocationData = new Location();
CalendarEventID = new EventID("");
SubEvents = new Dictionary<EventID, SubCalendarEvent>();
SchedulStatus = false;
otherPartyID = "";
CalendarError = Error;
EventSequence = new TimeLine();
}
示例8: CalendarEvent
public CalendarEvent()
{
EventDuration = new TimeSpan();
CalendarEventName = "";
StartDateTime = new DateTime();
EndDateTime = new DateTime();
EventPreDeadline = new TimeSpan();
PrepTime = new TimeSpan();
Priority = 0;
RepetitionFlag = false;
EventRepetition = new Repetition();
RigidSchedule = false;
Splits = 1;
LocationData = new Location();
CalendarEventID = new EventID("");
ArrayOfSubEvents = new SubCalendarEvent[0];
SchedulStatus = false;
otherPartyID = "";
CalendarError = new CustomErrors(false, string.Empty);
EventSequence = new TimeLine();
}
示例9: canExistTowardsStartWithoutSpace
public bool canExistTowardsStartWithoutSpace(TimeLine PossibleTimeLine)
{
TimeLine ParentCalRange = getCalendarEventRange;
bool retValue = ((PossibleTimeLine.Start + ActiveDuration) <= ParentCalRange.End) && (ParentCalRange.Start <= PossibleTimeLine.Start);
return retValue;
}
示例10: getJSONData
string getJSONData(Dictionary<string, My24HourTimerWPF.CalendarEvent> CalendarData, TimeLine RangeOfSchedule,string Name,TimeSpan TimeZoneSpan)
{
string TotalString = " ";
IEnumerable<CalendarEvent> RepeatCalendarEvent = CalendarData.Values.Where(obj => obj.RepetitionStatus);
IEnumerable<CalendarEvent> NonRepeatCalendarEvent = CalendarData.Values.Where(obj => !obj.RepetitionStatus);
string repeatDelimited = string.Join(",", RepeatCalendarEvent.Select(obj => RepeatCalendarEventToString(obj, RangeOfSchedule, TimeZoneSpan)));
string nonrepeatDelimited = string.Join(",", NonRepeatCalendarEvent.Select(obj => CalendarEventToString(obj, RangeOfSchedule, TimeZoneSpan)));
string repeatCalendarEventJSON = "\"RepeatCalendarEvent\":[" + repeatDelimited + "]";
string nonrepeatCalendarEventJSON = "\"NonRepeatCalendarEvent\":[" + nonrepeatDelimited + "]";
TotalString = repeatCalendarEventJSON + "," + nonrepeatCalendarEventJSON;
string retValue = "{\"Schedule\":{" + TotalString + "},\"Name\":\"" + Name + "\"}";
return retValue;
}
示例11: UpdateThis
public bool UpdateThis(SubCalendarEvent SubEventEntry)
{
if ((this.ID == SubEventEntry.ID)&&canExistWithinTimeLine(SubEventEntry.getCalendarEventRange))
{
StartDateTime= SubEventEntry.Start;
EndDateTime= SubEventEntry.End;
BusyFrame.updateBusyTimeLine(SubEventEntry.BusyFrame);
AvailablePreceedingFreeSpace = SubEventEntry.AvailablePreceedingFreeSpace;
RigidSchedule = SubEventEntry.Rigid;
CalendarEventRange = SubEventEntry.CalendarEventRange;
EventLocation = SubEventEntry.LocationData;
Enabled = SubEventEntry.Enabled;
ThirdPartyID = SubEventEntry.ThirdPartyID;
return true;
}
throw new Exception("Error Detected: Trying to update SubCalendar Event with non matching ID");
}
示例12: updateEventSequence
public override void updateEventSequence()
{
EventSequence = new TimeLine(this.Start, this.End);
EventSequence.AddBusySlots(BusyFrame);
}
示例13: shiftEvent
public bool shiftEvent(TimeSpan ChangeInTime, bool force=false)
{
TimeLine UpdatedTimeLine = new TimeLine(this.Start + ChangeInTime, this.End + ChangeInTime);
if (!(this.getCalendarEventRange.IsTimeLineWithin(UpdatedTimeLine))&&!force)
{
return false;
}
StartDateTime += ChangeInTime;
EndDateTime += ChangeInTime;
ActiveSlot.shiftTimeline(ChangeInTime);
return true;
}
示例14: RepeatCalendarEventToString
string RepeatCalendarEventToString(CalendarEvent arg1,TimeLine RangeOfSchedule,TimeSpan TimeZoneSpan)
{
/*
* This funciton takes a repeating CalendarEvent and converts it to a JSON formatted string;
*/
string IDString="\""+arg1.ID+"\"";
string TotalString = "";
string RepeatCalendarName = "\"" + arg1.Name + "\"";
string RepeatStartDate = "\"" + arg1.Start.ToString() + "\"";
string RepeatEndDate = "\"" + arg1.End.ToString() + "\"";
string RepeatTotalDuration = "\"" + arg1.ActiveDuration.ToString() + "\"";
string RepeatRigid = "\"" + arg1.Rigid + "\"";
string RepeatAddressDescription = "\"" + arg1.myLocation.Description + "\"";
string RepeatAddress = "\"" + arg1.myLocation.Address + "\"";
string Long = "\"" + arg1.myLocation.YCoordinate + "\"";
string Lat = "\"" + arg1.myLocation.XCoordinate + "\"";
string Delimited = string.Join(",", arg1.Repeat.RecurringCalendarEvents.Select(obj => CalendarEventToString(obj, RangeOfSchedule, TimeZoneSpan)));
string AllCalEventString = "["+Delimited+"]";
TotalString = "{\"ID\":" + IDString + ",\"RepeatCalendarName\":" + RepeatCalendarName + ",\"RepeatStartDate\":" + RepeatStartDate + ",\"RepeatEndDate\":" + RepeatEndDate + ",\"RepeatTotalDuration\":" + RepeatTotalDuration + ",\"RepeatRigid\":" + RepeatRigid + ",\"RepeatAddressDescription\": " + RepeatAddressDescription + ",\"RepeatAddress\":" + RepeatAddress + ",\"RepeatCalendarEvents\":" + AllCalEventString + ",\"Latitude\":" + Lat + ",\"Longitude\":" + Long + "}";
string retValue=TotalString ;
return retValue;
}
示例15: 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;
}