public Attendee Add(Participant participant, AttendeeType attendeeType = AttendeeType.Required, ResponseType?responseType = null, ExDateTime?replyTime = null, bool checkExisting = false) { return(AttendeeCollection.InternalAdd(this, delegate { int num; Attendee attendee = OccurrenceAttendeeCollection.FindAttendee(this.exceptionAttendeeCollection, participant, this.occurrence.Session as MailboxSession, out num); if (attendee != null && attendee.HasFlags(RecipientFlags.ExceptionalDeleted)) { attendee.RecipientFlags &= ~RecipientFlags.ExceptionalDeleted; this.exceptionAttendeeCollection.Remove(attendee); this.exceptionAttendeeCollection.LocationIdentifierHelperInstance.SetLocationIdentifier(46965U); attendee = this.exceptionAttendeeCollection.AddClone(attendee); attendee.AttendeeType = attendeeType; if (responseType != null) { attendee.ResponseType = responseType.Value; } if (replyTime != null) { attendee.ReplyTime = replyTime.Value; } } else { attendee = this.exceptionAttendeeCollection.Add(participant, attendeeType, responseType, replyTime, checkExisting); } this.attendeeCollection.Add(attendee); return attendee; }, participant, attendeeType, responseType, checkExisting)); }
internal void ApplyChangesToExceptionAttendeeCollection(MapiMessage exceptionMessage) { if (this.IsDirty) { this.Cleanup(); for (int i = 0; i < this.masterAttendeeCount; i++) { Attendee attendee = this.attendeeCollection[i]; if (attendee.IsDirty && !this.exceptionAttendeeCollection.Contains(attendee)) { this.exceptionAttendeeCollection.AddClone(attendee); } } if (this.exceptionAttendeeCollection.CoreItem.MapiMessage != exceptionMessage) { CoreRecipientCollection recipients = this.occurrence.OccurrencePropertyBag.ExceptionMessage.CoreItem.Recipients; AttendeeCollection attendeeCollection = new AttendeeCollection(recipients); foreach (Attendee attendee2 in this.exceptionAttendeeCollection) { if (attendee2.IsDirty) { attendeeCollection.AddClone(attendee2); } } this.exceptionAttendeeCollection = attendeeCollection; this.occurrence.OccurrencePropertyBag.MasterCalendarItem.AbandonRecipientChanges(); this.LoadMasterAttendeeCollection(); this.BuildOccurrenceAttendeeCollection(); } } }
internal static Attendee InternalAdd(IAttendeeCollection attendeeCollection, Func <Attendee> performAdd, Participant participant, AttendeeType attendeeType = AttendeeType.Required, ResponseType?responseType = null, bool checkExisting = false) { if (participant == null) { throw new ArgumentNullException("participant"); } EnumValidator.ThrowIfInvalid <AttendeeType>(attendeeType, "attendeeType"); if (responseType != null) { EnumValidator.ThrowIfInvalid <ResponseType>(responseType.Value, "responseType"); } if (checkExisting) { int num = AttendeeCollection.IndexOf(attendeeCollection, participant, false); if (num != -1) { Attendee attendee = attendeeCollection[num]; if (attendeeType != AttendeeType.Required || attendee.AttendeeType == AttendeeType.Required) { return(attendee); } attendeeCollection.RemoveAt(num); } } return(performAdd()); }
public Attendee Add(Participant participant, AttendeeType attendeeType = AttendeeType.Required, ResponseType?responseType = null, ExDateTime?replyTime = null, bool checkExisting = false) { return(AttendeeCollection.InternalAdd(this, delegate { Attendee attendeeToAdd = this.GetAttendeeToAdd(participant); attendeeToAdd.AttendeeType = attendeeType; if (responseType != null) { attendeeToAdd.ResponseType = responseType.Value; } if (replyTime != null) { attendeeToAdd.ReplyTime = replyTime.Value; } this.ReportRecipientChange(LastChangeAction.RecipientAdded); return attendeeToAdd; }, participant, attendeeType, responseType, checkExisting)); }
private void Cleanup() { AttendeeCollection.Cleanup(this.masterAttendeeCollection); AttendeeCollection.Cleanup(this.exceptionAttendeeCollection); }
void IAttendeeCollectionImpl.Cleanup() { AttendeeCollection.Cleanup(this); }