public static bool AreListsEqual(List <AttendeeData> list1, List <AttendeeData> list2) { if (list1 == null != (list2 == null)) { return(false); } if (list1 == null) { return(true); } if (list1.Count != list2.Count) { return(false); } for (int i = 0; i < list1.Count; i++) { AttendeeData attendeeData = list1[i]; AttendeeData obj = list2[i]; if (!attendeeData.Equals(obj)) { return(false); } } return(true); }
public override bool Equals(object obj) { if (obj == null) { return(false); } AttendeeData attendeeData = obj as AttendeeData; if (attendeeData == null) { return(false); } if (this.attendeeType != attendeeData.attendeeType) { return(false); } if (this.participant == null != (attendeeData.participant == null)) { return(false); } if (this.participant != null && !this.participant.Equals(attendeeData.participant)) { return(false); } if (this.recipientIdBytes == null != (attendeeData.recipientIdBytes == null)) { return(false); } if (this.recipientIdBytes != null) { if (this.recipientIdBytes.Length != attendeeData.recipientIdBytes.Length) { return(false); } for (int i = 0; i < this.recipientIdBytes.Length; i++) { if (this.recipientIdBytes[i] != attendeeData.recipientIdBytes[i]) { return(false); } } } return(true); }
public AttendeeData(Attendee attendee) { this.attendeeType = attendee.AttendeeType; this.participant = AttendeeData.CloneParticipant(attendee.Participant); this.recipientIdBytes = attendee.Id.GetBytes(); }
public AttendeeData(Participant participant, AttendeeType attendeeType) { this.attendeeType = attendeeType; this.participant = AttendeeData.CloneParticipant(participant); }
public AttendeeData(AttendeeData other) { this.attendeeType = other.attendeeType; this.participant = AttendeeData.CloneParticipant(other.participant); this.recipientIdBytes = (byte[])other.recipientIdBytes.Clone(); }
public virtual void SetFrom(CalendarItemBase calendarItemBase) { if (this.attachmentIds == null) { this.attachmentIds = new List <AttachmentId>(); } else { this.attachmentIds.Clear(); } if (this.attendees == null) { this.attendees = new List <AttendeeData>(); } else { this.attendees.Clear(); } if (calendarItemBase.AttachmentCollection != null) { foreach (AttachmentHandle handle in calendarItemBase.AttachmentCollection) { using (Attachment attachment = calendarItemBase.AttachmentCollection.Open(handle)) { if (attachment.Id == null) { throw new ArgumentNullException("attachment.Id"); } this.attachmentIds.Add(attachment.Id); } } } if (calendarItemBase.Body != null) { this.bodyText = ItemUtility.GetItemBody(calendarItemBase, BodyFormat.TextPlain); this.bodyFormat = BodyFormat.TextPlain; } this.calendarItemType = calendarItemBase.CalendarItemType; this.endTime = calendarItemBase.EndTime; this.freeBusyStatus = calendarItemBase.FreeBusyStatus; try { if (calendarItemBase.ParentId != null) { this.folderId = StoreObjectId.Deserialize(calendarItemBase.ParentId.GetBytes()); } else { this.folderId = null; } if (calendarItemBase.Id != null && calendarItemBase.Id.ObjectId != null) { this.id = StoreObjectId.Deserialize(calendarItemBase.Id.ObjectId.GetBytes()); } else { this.id = null; } } catch (ArgumentException) { throw new OwaInvalidRequestException("Invalid store object id"); } catch (FormatException) { throw new OwaInvalidRequestException("Invalid store object id"); } if (calendarItemBase.Id != null) { this.changeKey = calendarItemBase.Id.ChangeKeyAsBase64String(); } else { this.changeKey = null; } this.importance = calendarItemBase.Importance; this.isAllDayEvent = calendarItemBase.IsAllDayEvent; this.isMeeting = calendarItemBase.IsMeeting; this.isOrganizer = calendarItemBase.IsOrganizer(); this.isResponseRequested = CalendarItemBaseData.GetIsResponseRequested(calendarItemBase); this.location = calendarItemBase.Location; this.meetingRequestWasSent = calendarItemBase.MeetingRequestWasSent; this.organizer = AttendeeData.CloneParticipant(calendarItemBase.Organizer); if (calendarItemBase.ParentId != null) { this.parentId = StoreObjectId.FromProviderSpecificId(calendarItemBase.ParentId.ProviderLevelItemId); } if (calendarItemBase.AttendeeCollection != null) { foreach (Attendee attendee in calendarItemBase.AttendeeCollection) { this.attendees.Add(new AttendeeData(attendee)); } } this.sensitivity = calendarItemBase.Sensitivity; this.startTime = calendarItemBase.StartTime; this.subject = calendarItemBase.Subject; }