예제 #1
0
        private Dictionary <string, Attendee> GetUniqueExceptionAttendees()
        {
            Dictionary <string, Attendee> dictionary = new Dictionary <string, Attendee>();

            foreach (Attendee attendee in this.exceptionAttendeeCollection)
            {
                string attendeeKey = attendee.GetAttendeeKey();
                if (!dictionary.ContainsKey(attendeeKey))
                {
                    dictionary.Add(attendeeKey, attendee);
                }
                else
                {
                    Attendee attendee2;
                    dictionary.TryGetValue(attendeeKey, out attendee2);
                    RecipientFlags recipientFlags = attendee2.RecipientFlags;
                    if ((recipientFlags & RecipientFlags.ExceptionalDeleted) == RecipientFlags.ExceptionalDeleted)
                    {
                        dictionary.Remove(attendeeKey);
                        dictionary.Add(attendeeKey, attendee);
                    }
                }
            }
            return(dictionary);
        }
예제 #2
0
        private void UpdateParticipantsOnCalendarItem(CalendarItemBase calendarItem, bool isReadOnlyItem)
        {
            this.CheckDisposed("ProcessParticipants");
            base.LocationIdentifierHelperInstance.SetLocationIdentifier(62325U, LastChangeAction.ProcessParticipants);
            IAttendeeCollection attendeeCollection = calendarItem.AttendeeCollection;

            calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(37749U);
            attendeeCollection.Clear();
            bool flag = false;

            if (base.From != null)
            {
                calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(54133U);
                attendeeCollection.Add(base.From, AttendeeType.Required, null, null, false).RecipientFlags = (RecipientFlags.Sendable | RecipientFlags.Organizer);
                flag = true;
            }
            List <BlobRecipient> list = this.GetUnsendableRecipients();

            if (!isReadOnlyItem)
            {
                this.SetUnsendableRecipients(list);
            }
            list = MeetingRequest.MergeRecipientLists(base.Recipients, list);
            Participant participant = null;

            if (base.IsDelegated())
            {
                participant = (Participant)base.TryGetProperty(InternalSchema.ReceivedBy);
            }
            foreach (BlobRecipient blobRecipient in list)
            {
                RecipientFlags valueOrDefault = blobRecipient.GetValueOrDefault <RecipientFlags>(InternalSchema.RecipientFlags);
                bool           flag2          = (valueOrDefault & RecipientFlags.Organizer) == RecipientFlags.Organizer;
                if (flag2)
                {
                    if (flag)
                    {
                        continue;
                    }
                    flag = true;
                }
                if (!blobRecipient.Participant.AreAddressesEqual(base.From))
                {
                    RecipientItemType type         = MapiUtil.MapiRecipientTypeToRecipientItemType(blobRecipient.GetValueOrDefault <RecipientType>(InternalSchema.RecipientType, RecipientType.To));
                    AttendeeType      attendeeType = Attendee.RecipientItemTypeToAttendeeType(type);
                    Participant       participant2 = blobRecipient.Participant;
                    if (participant != null && Participant.HasSameEmail(participant2, participant, base.MailboxSession, true))
                    {
                        calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(41845U);
                        attendeeCollection.Add(base.ReceivedRepresenting, attendeeType, null, null, false);
                        participant = null;
                    }
                    else
                    {
                        calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(58229U);
                        attendeeCollection.Add(participant2, attendeeType, null, null, false);
                    }
                }
            }
        }
예제 #3
0
        internal static void Cleanup(IAttendeeCollection attendees)
        {
            HashSet <string> hashSet = new HashSet <string>();
            List <Attendee>  list    = new List <Attendee>();

            foreach (Attendee attendee in attendees)
            {
                if (attendee.Participant.RoutingType == "SMTP" || attendee.Participant.RoutingType == "EX")
                {
                    RecipientFlags recipientFlags = attendee.RecipientFlags;
                    bool           flag           = (recipientFlags & RecipientFlags.ExceptionalDeleted) == RecipientFlags.ExceptionalDeleted;
                    string         item           = attendee.GetAttendeeKey() + (flag ? ":D" : ":ND");
                    if (!hashSet.Contains(item))
                    {
                        hashSet.Add(item);
                    }
                    else
                    {
                        list.Add(attendee);
                    }
                }
            }
            foreach (Attendee item2 in list)
            {
                attendees.Remove(item2);
            }
        }
예제 #4
0
        public MessageRecipient GetRecipient(int rowIndex)
        {
            MessageRecipient result = new MessageRecipient();

            result.DisplayName  = GetStringProperty(rowIndex, PropertyID.PidTagDisplayName);
            result.EmailAddress = GetStringProperty(rowIndex, PropertyID.PidTagEmailAddress);
            RecipientFlags recipientFlags = (RecipientFlags)GetInt32Property(rowIndex, PropertyID.PidTagRecipientFlags);

            result.IsOrganizer = ((recipientFlags & RecipientFlags.MeetingOrganizer) > 0);
            return(result);
        }
예제 #5
0
        public MessageRecipient GetRecipient(int rowIndex)
        {
            MessageRecipient result = new MessageRecipient();

            result.DisplayName  = GetStringProperty(rowIndex, PropertyID.PidTagDisplayName);
            result.EmailAddress = GetStringProperty(rowIndex, PropertyID.PidTagEmailAddress);
            if (ContainsPropertyColumn(PropertyID.PidTagRecipientFlags, PropertyTypeName.PtypInteger32))
            {
                RecipientFlags recipientFlags = (RecipientFlags)GetInt32Property(rowIndex, PropertyID.PidTagRecipientFlags);
                result.IsOrganizer = ((recipientFlags & RecipientFlags.MeetingOrganizer) > 0);
            }
            return(result);
        }
예제 #6
0
        private void RemoveExceptionalDeletedAttendees(Dictionary <string, Attendee> uniqueExceptionAttendees)
        {
            int             num  = 0;
            List <Attendee> list = new List <Attendee>();

            foreach (KeyValuePair <string, Attendee> keyValuePair in uniqueExceptionAttendees)
            {
                Attendee value = keyValuePair.Value;
                if (value.Participant.RoutingType != null && value.Participant.EmailAddress != null)
                {
                    string         key            = keyValuePair.Key;
                    RecipientFlags recipientFlags = value.RecipientFlags;
                    if ((recipientFlags & RecipientFlags.ExceptionalDeleted) == RecipientFlags.ExceptionalDeleted)
                    {
                        int i = 0;
                        while (i < this.attendeeCollection.Count)
                        {
                            Attendee attendee    = this.attendeeCollection[i];
                            string   attendeeKey = attendee.GetAttendeeKey();
                            if (key == attendeeKey)
                            {
                                list.Add(attendee);
                                if (i < this.masterAttendeeCount)
                                {
                                    num++;
                                    break;
                                }
                                break;
                            }
                            else
                            {
                                i++;
                            }
                        }
                    }
                }
            }
            this.masterAttendeeCount -= num;
            foreach (Attendee item in list)
            {
                this.attendeeCollection.Remove(item);
            }
        }
예제 #7
0
 private void JoinAttendees(Dictionary <string, Attendee> uniqueExceptionAttendees)
 {
     foreach (Attendee item in this.masterAttendeeCollection)
     {
         this.attendeeCollection.Add(item);
     }
     this.masterAttendeeCount = this.masterAttendeeCollection.Count;
     if (this.masterAttendeeCollection.CoreItem != this.exceptionAttendeeCollection.CoreItem)
     {
         foreach (KeyValuePair <string, Attendee> keyValuePair in uniqueExceptionAttendees)
         {
             RecipientFlags recipientFlags = keyValuePair.Value.RecipientFlags;
             if ((recipientFlags & RecipientFlags.ExceptionalDeleted) != RecipientFlags.ExceptionalDeleted)
             {
                 this.AddExceptionalAttendee(keyValuePair.Value);
             }
         }
     }
 }
예제 #8
0
 internal bool HasFlags(RecipientFlags flags)
 {
     return((this.RecipientFlags & flags) == flags);
 }