예제 #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is EventRecurrence))
            {
                return(false);
            }
            EventRecurrence target = obj as EventRecurrence;
            bool            exceptionsEqual;

            if (this.Exceptions == null || this.Exceptions.Count == 0)
            {
                exceptionsEqual = target.Exceptions == null || target.Exceptions.Count == 0;
            }
            else
            {
                exceptionsEqual = (target.Exceptions != null) && (target.Exceptions.Count != 0) &&
                                  this.Exceptions.SequenceEqual(target.Exceptions, new RecurrenceExceptionComparer());
            }
            return
                (this.Count == target.Count &&
                 this.DayOfMonth == target.DayOfMonth &&
                 this.DayOfWeekMask == target.DayOfWeekMask &&
                 this.EndDate == target.EndDate &&
                 this.EndMethod == target.EndMethod &&
                 this.Frequency == target.Frequency &&
                 this.Interval == target.Interval &&
                 this.Month == target.Month &&
                 this.StartDate == target.StartDate &&
                 this.WeekInterval == target.WeekInterval &&
                 exceptionsEqual);
        }
예제 #2
0
 internal RecurrenceException(Outlook.Exception outlookException, EventRecurrence parentRecurrence = null)
 {
     this._parentRecurrence = parentRecurrence != null ? parentRecurrence : new EventRecurrence(outlookException.Parent as Outlook.RecurrencePattern);
     this.OriginalDate      = outlookException.OriginalDate;
     this.Deleted           = outlookException.Deleted;
     if (!this.Deleted)
     {
         this.ModifiedEvent = new CalendarEvent(outlookException.AppointmentItem);
     }
 }
예제 #3
0
 internal RecurrenceException(Event googleException, IList <EventReminder> googleDefaultReminders, EventRecurrence parentRecurrence = null)
 {
     this._parentRecurrence = parentRecurrence ?? null;
     this.OriginalDate      = googleException.OriginalStartTime.DateTime.HasValue
         ? googleException.OriginalStartTime.DateTime.Value
         : DateTime.Parse(googleException.OriginalStartTime.Date);
     this.Deleted = googleException.Status == "cancelled";
     if (!this.Deleted)
     {
         this.ModifiedEvent = new CalendarEvent(googleException, googleDefaultReminders);
     }
 }
예제 #4
0
 internal RecurrenceException(EventRecurrence parentRecurrence, DateTime originalDate)
 {
     this._parentRecurrence = parentRecurrence;
     this.OriginalDate      = originalDate;
 }