Exemplo n.º 1
0
        private void SendOrganizerRums(OrganizerRumInfo info, bool copyToSentItems, CalendarItemBase item, ref Dictionary <GlobalObjectId, List <Attendee> > sentRumsToCheck)
        {
            bool            flag = false;
            List <Attendee> list;

            if (sentRumsToCheck.ContainsKey(item.GlobalObjectId))
            {
                flag = true;
                list = sentRumsToCheck[item.GlobalObjectId];
                for (int i = info.AttendeeList.Count - 1; i > -1; i--)
                {
                    Attendee attendee = info.AttendeeList[i];
                    if (!attendee.IsSendable() || this.AttendeeListContainsParticipant(list, attendee.Participant, item.Session as MailboxSession))
                    {
                        info.AttendeeList.RemoveAt(i);
                    }
                }
            }
            else
            {
                list = new List <Attendee>(info.AttendeeList.Count);
            }
            if (info.AttendeeList.Count != 0)
            {
                if (info is UpdateRumInfo)
                {
                    UpdateRumInfo rumInfo = (UpdateRumInfo)info;
                    if (item.CalendarItemType == CalendarItemType.Occurrence)
                    {
                        item.SendForwardRum(rumInfo, copyToSentItems);
                    }
                    else
                    {
                        item.SendUpdateRums(rumInfo, copyToSentItems);
                    }
                }
                else
                {
                    if (!(info is CancellationRumInfo))
                    {
                        throw new NotSupportedException(info.GetType().ToString());
                    }
                    CancellationRumInfo rumInfo2 = (CancellationRumInfo)info;
                    item.SendCancellationRums(rumInfo2, copyToSentItems);
                }
                list.AddRange(info.AttendeeList);
                if (!flag)
                {
                    sentRumsToCheck.Add(item.GlobalObjectId, list);
                }
            }
            info.AttendeeList.Clear();
        }
Exemplo n.º 2
0
        private bool SendRumsBase(RumInfo info, bool copyToSentItems, CalendarItemBase item, ref Dictionary <GlobalObjectId, List <Attendee> > organizerRumsSent)
        {
            bool flag = false;

            if (info.Type != RumType.None)
            {
                if (info is OrganizerRumInfo)
                {
                    OrganizerRumInfo info2 = (OrganizerRumInfo)info;
                    this.SendOrganizerRums(info2, copyToSentItems, item, ref organizerRumsSent);
                    flag = true;
                }
                else if (info is ResponseRumInfo)
                {
                    item.SendResponseRum((ResponseRumInfo)info, copyToSentItems);
                    flag = true;
                }
                else
                {
                    if (!(info is AttendeeInquiryRumInfo))
                    {
                        throw new NotSupportedException(info.GetType().ToString());
                    }
                    if (((AttendeeInquiryRumInfo)info).WouldRepair)
                    {
                        item.SendAttendeeInquiryRum((AttendeeInquiryRumInfo)info, copyToSentItems);
                        flag = true;
                    }
                }
                if (flag)
                {
                    info.SendTime = new ExDateTime?(ExDateTime.Now);
                }
                item.Load();
            }
            return(flag);
        }