public SubCalendarEvent(string MySubEventID, BusyTimeLine MyBusylot, DateTime EventStart, DateTime EventDeadline, TimeSpan EventPrepTime, string myParentID, bool Rigid,bool Enabled, EventDisplay UiParam, MiscData Notes, bool completeFlag, Location EventLocation = null, TimeLine RangeOfSubCalEvent = null)
        {
            CalendarEventRange = RangeOfSubCalEvent;
            //string eventName, TimeSpan EventDuration, DateTime EventStart, DateTime EventDeadline, TimeSpan EventPrepTime, TimeSpan PreDeadline, bool EventRigidFlag, bool EventRepetition, int EventSplit
            StartDateTime = EventStart;
            EndDateTime = EventDeadline;
            EventDuration = MyBusylot.End - MyBusylot.Start;
            BusyFrame = MyBusylot;
            PrepTime = EventPrepTime;
            SubEventID = new EventID(MySubEventID.Split('_'));
            this.EventLocation = EventLocation;

            UiParams=UiParam;
            DataBlob= Notes;
            Complete = completeFlag;

            this.Enabled = Enabled;
            EventSequence = new EventTimeLine(SubEventID.ToString(), StartDateTime, EndDateTime);
            RigidSchedule = Rigid;
        }
 public SubCalendarEvent(TimeSpan Event_Duration, DateTime EventStart, DateTime EventDeadline, TimeSpan EventPrepTime, string myParentID, bool Rigid, bool Enabled, EventDisplay UiParam,MiscData Notes,bool completeFlag, Location EventLocation =null, TimeLine RangeOfSubCalEvent = null)
 {
     CalendarEventRange = RangeOfSubCalEvent;
     StartDateTime = EventStart;
     EndDateTime = EventDeadline;
     EventDuration = Event_Duration;
     PrepTime = EventPrepTime;
     if (myParentID == "16")
     {
         ;
     }
     UiParams=UiParam;
     DataBlob = Notes;
     Complete=completeFlag;
     SubEventID = new EventID(myParentID + "_" + EventIDGenerator.generate().ToString());
     BusyFrame = new BusyTimeLine(this.ID, StartDateTime, EndDateTime);//this is because in current implementation busy frame is the same as CalEvent frame
     this.EventLocation = EventLocation;
     EventSequence = new EventTimeLine(SubEventID.ToString(), StartDateTime, EndDateTime);
     RigidSchedule = Rigid;
     this.Enabled = Enabled;
 }
Example #3
0
        virtual public bool updateSubEvent(EventID SubEventID,SubCalendarEvent UpdatedSubEvent)
        {
            if (this.RepetitionStatus)
            {
                foreach (CalendarEvent MyCalendarEvent in Repeat.RecurringCalendarEvents)
                {
                    if (MyCalendarEvent.updateSubEvent(SubEventID, UpdatedSubEvent))
                    {
                        return true;
                    }
                }
            }
            else 
            {
                int i = 0;
                for (i = 0; i < ArrayOfSubEvents.Length;i++)
                {
                    if (ArrayOfSubEvents[i].ID == SubEventID.ToString())
                    {
                        SubCalendarEvent NewSubCalEvent = new SubCalendarEvent(UpdatedSubEvent.ID, UpdatedSubEvent.Start, UpdatedSubEvent.End, UpdatedSubEvent.ActiveSlot, UpdatedSubEvent.Rigid, UpdatedSubEvent.myLocation, this.RangeTimeLine);
                        string thirdPartyID = ArrayOfSubEvents[i].ThirdPartyID;
                        ArrayOfSubEvents[i] = NewSubCalEvent;
                        ArrayOfSubEvents[i].ThirdPartyID = thirdPartyID;
                        return true;
                    }
                }
            }

            return false;
        }
Example #4
0
        //CalendarEvent Methods
        public SubCalendarEvent getSubEvent(EventID SubEventID)
        {
            int i = 0;

            if (Repeat.Enable)
            {
                foreach (CalendarEvent MyCalendarEvent in EventRepetition.RecurringCalendarEvents)
                {
                    SubCalendarEvent MySubEvent = MyCalendarEvent.getSubEvent(SubEventID);
                    if (MySubEvent != null)
                    {
                        return MySubEvent;
                    }
                }
            }

            for (; i < ArrayOfSubEvents.Length; i++)
            {
                if (SubEventID.ToString() == ArrayOfSubEvents[i].ID)
                {
                    return ArrayOfSubEvents[i];
                }

            }
            return null;
        }
 public TimeSpanWithEventID(int days, int hours, int minutes, int seconds, int milliseconds, EventID ID)
 {
     timeSpan = new TimeSpan(days, hours, minutes, seconds);
     TimeSpanID = new EventID(ID.ToString());
 }
Example #6
0
        public virtual bool updateSubEvent(EventID SubEventID,SubCalendarEvent UpdatedSubEvent)
        {
            if (this.RepetitionStatus)
            {
                foreach (CalendarEvent MyCalendarEvent in Repeat.RecurringCalendarEvents)
                {
                    if (MyCalendarEvent.updateSubEvent(SubEventID, UpdatedSubEvent))
                    {
                        return true;
                    }
                }
            }
            else 
            {
                if (SubEvents.ContainsKey(SubEventID))
                {
                    SubCalendarEvent NewSubCalEvent = new SubCalendarEvent(SubEventID.ToString(), UpdatedSubEvent.Start, UpdatedSubEvent.End, UpdatedSubEvent.ActiveSlot, UpdatedSubEvent.Rigid, UpdatedSubEvent.isEnabled, UpdatedSubEvent.UiParams, UpdatedSubEvent.Notes, UpdatedSubEvent.Complete, UpdatedSubEvent.myLocation, this.RangeTimeLine);
                    SubCalendarEvent CurrentSubEvent = SubEvents[SubEventID];
                    NewSubCalEvent.ThirdPartyID = CurrentSubEvent.ThirdPartyID;
                    SubEvents[SubEventID] = NewSubCalEvent;//using method as opposed to the UpdateThis function because of the canexistwithintimeline function test in the UpdateThis function
                    return true;
                }
            }

            return false;
        }
Example #7
0
        public CalendarEvent(string EventName, TimeSpan Event_Duration, DateTime EventStart, DateTime EventDeadline, TimeSpan EventPrepTime, TimeSpan Event_PreDeadline, bool EventRigidFlag, Repetition EventRepetitionEntry, int EventSplit, Location EventLocation, bool EnableFlag, EventDisplay UiData, MiscData NoteData, bool CompletionFlag)
        {
            CalendarEventName = EventName;
            /*CalendarEventName = EventName.Split(',')[0];
            LocationString = "";
            if (EventName.Split(',').Length > 1)
            {
                LocationString = EventName.Split(',')[1];
            }
            CalendarEventLocation = null;
            CalendarEventLocation = new Location();
            if (LocationString != "")
            {
                CalendarEventLocation = new Location(LocationString);
            }
            */
            StartDateTime = EventStart;
            EndDateTime = EventDeadline;
            EventDuration = Event_Duration;
            PrepTime = EventPrepTime;
            EventPreDeadline = Event_PreDeadline;
            RigidSchedule = EventRigidFlag;
            LocationData = EventLocation;
            CalendarEventID = new EventID(new string[] { EventIDGenerator.generate().ToString() });
            EventRepetition = EventRepetitionEntry;

            UiParams = UiData;
            DataBlob = NoteData;
            Complete = CompletionFlag;


            if (EventRepetition.Enable)
            {
                Splits = EventSplit;
                TimePerSplit = new TimeSpan();
            }
            else
            {
                Splits = EventSplit;
                TimePerSplit = TimeSpan.FromTicks(((EventDuration.Ticks / Splits)));
            }

            SubEvents = new Dictionary<EventID, SubCalendarEvent>();
            for (int i = 0; i < Splits; i++)
            {
                SubCalendarEvent newSubCalEvent = new SubCalendarEvent(TimePerSplit, (EndDateTime - TimePerSplit), this.End, new TimeSpan(), CalendarEventID.ToString(), RigidSchedule, this.Enabled, this.UiParams, this.Notes, this.Complete, EventLocation, this.RangeTimeLine); //new SubCalendarEvent(CalendarEventID);
                SubEvents.Add(newSubCalEvent.SubEvent_ID, newSubCalEvent);
            }

            
            
            EventSequence = new TimeLine(StartDateTime, EndDateTime);
            UpdateLocationMatrix(LocationData);
        }
Example #8
0
        public CalendarEvent(EventID EventIDEntry, string EventName, TimeSpan Event_Duration, DateTime EventStart, DateTime EventDeadline, TimeSpan EventPrepTime, TimeSpan Event_PreDeadline, bool EventRigidFlag, Repetition EventRepetitionEntry, int EventSplit, Location EventLocation, bool enabledFlag, EventDisplay UiData, MiscData NoteData, bool CompletionFlag)
        {
            CalendarEventName = EventName;
            StartDateTime = EventStart;
            EndDateTime = EventDeadline;
            EventDuration = Event_Duration;
            Enabled = enabledFlag;
            EventRepetition = EventRepetitionEntry;
            PrepTime = EventPrepTime;
            EventPreDeadline = Event_PreDeadline;
            RigidSchedule = EventRigidFlag;
            LocationData = EventLocation;
            CalendarEventID = EventIDEntry;
            UiParams = UiData;
            DataBlob = NoteData;
            Complete = CompletionFlag;

            if (EventRepetition.Enable)
            {
                Splits = EventSplit;
                TimePerSplit = new TimeSpan();
            }
            else
            {
                Splits = EventSplit;
                TimePerSplit = TimeSpan.FromTicks(((EventDuration.Ticks / Splits)));
            }
            SubEvents = new Dictionary<EventID, SubCalendarEvent>();
            for (int i = 0; i < Splits; i++)
            {
                //(TimeSpan Event_Duration, DateTime EventStart, DateTime EventDeadline, TimeSpan EventPrepTime, string myParentID, bool Rigid, Location EventLocation =null, TimeLine RangeOfSubCalEvent = null)
                SubCalendarEvent newSubCalEvent = new SubCalendarEvent(TimePerSplit, (EndDateTime - TimePerSplit), this.End, new TimeSpan(), CalendarEventID.ToString(), RigidSchedule,this.isEnabled, this.UiParams,this.Notes,this.Complete, EventLocation, this.RangeTimeLine);
                SubEvents.Add(newSubCalEvent.SubEvent_ID, newSubCalEvent);
            }

            EventSequence = new TimeLine(StartDateTime, EndDateTime);
            UpdateLocationMatrix(EventLocation);
        }
Example #9
0
        public CalendarEvent getCalendarEvent(EventID myEventID)
        {

            CalendarEvent calEvent = AllEventDictionary[myEventID.ID[0]];

            CalendarEvent repeatEvent = calEvent.getRepeatedCalendarEvent(myEventID.ToString());


            if (repeatEvent == null)
            {
                return calEvent;
            }
            else
            {
                return repeatEvent;
            }
            
            //return AllEventDictionary[myEventID.ID[0]];
        }