コード例 #1
0
        internal static RumDecorator CreateInstance(RumInfo info)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }
            RumDecorator rumDecorator = new RumDecorator();

            rumDecorator.Initialize(info);
            return(rumDecorator);
        }
コード例 #2
0
        protected override void Merge(RumInfo infoToMerge)
        {
            if (infoToMerge is UpdateRumInfo)
            {
                base.Merge(infoToMerge);
                UpdateRumInfo updateRumInfo = (UpdateRumInfo)infoToMerge;
                this.InconsistencyFlagList = this.InconsistencyFlagList.Union(updateRumInfo.InconsistencyFlagList);
                return;
            }
            string message = string.Format("An update RUM can be merged only with another update RUM. RumInfo type is {0}", infoToMerge.GetType());

            throw new ArgumentException(message, "infoToMerge");
        }
コード例 #3
0
ファイル: RumAgent.cs プロジェクト: YHZX2013/exchange_diff
        public bool SendRums(RumInfo info, bool copyToSentItems, CalendarItemBase item, ref Dictionary <GlobalObjectId, List <Attendee> > organizerRumsSent)
        {
            bool result = false;

            if (info == null)
            {
                throw new ArgumentNullException("info");
            }
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (organizerRumsSent == null)
            {
                throw new ArgumentNullException("organizerRumsSent");
            }
            if (info.IsOccurrenceRum)
            {
                if (item is CalendarItemOccurrence)
                {
                    ExDateTime originalStartTime = ((CalendarItemOccurrence)item).OriginalStartTime;
                    result = this.SendRumsBase(info, copyToSentItems, item, ref organizerRumsSent);
                }
                else
                {
                    if (!(item is CalendarItem))
                    {
                        throw new ArgumentException("The calendar item's type is unrecognized.", "item");
                    }
                    CalendarItem calendarItem = (CalendarItem)item;
                    using (CalendarItemBase calendarItemBase = calendarItem.OpenOccurrenceByOriginalStartTime(info.OccurrenceOriginalStartTime.Value, new PropertyDefinition[0]))
                    {
                        calendarItemBase.OpenAsReadWrite();
                        result = this.SendRumsBase(info, copyToSentItems, calendarItemBase, ref organizerRumsSent);
                    }
                    item.Load();
                }
            }
            else
            {
                result = this.SendRumsBase(info, copyToSentItems, item, ref organizerRumsSent);
            }
            return(result);
        }
コード例 #4
0
ファイル: RumInfo.cs プロジェクト: YHZX2013/exchange_diff
 public static RumInfo Merge(RumInfo info1, RumInfo info2)
 {
     if (info1 == null)
     {
         throw new ArgumentNullException("info1");
     }
     if (info2 == null)
     {
         throw new ArgumentNullException("info2");
     }
     if (info1.IsNullOp)
     {
         return(info2);
     }
     if (info2.IsNullOp)
     {
         return(info1);
     }
     info1.Merge(info2);
     return(info1);
 }
コード例 #5
0
ファイル: RumAgent.cs プロジェクト: YHZX2013/exchange_diff
        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);
        }
コード例 #6
0
ファイル: RumInfo.cs プロジェクト: YHZX2013/exchange_diff
 protected virtual void Merge(RumInfo infoToMerge)
 {
     if (infoToMerge == null)
     {
         throw new ArgumentNullException("infoToMerge");
     }
     if (!infoToMerge.IsNullOp)
     {
         if (this.OccurrenceOriginalStartTime == null)
         {
             if (infoToMerge.OccurrenceOriginalStartTime != null)
             {
                 throw new ArgumentException("Cannot merge a master RUM info with an occurrence RUM info.", "infoToMerge");
             }
         }
         else
         {
             if (infoToMerge.OccurrenceOriginalStartTime == null)
             {
                 throw new ArgumentException("Cannot merge an occurrence RUM info with a master RUM info.", "infoToMerge");
             }
             if (!this.OccurrenceOriginalStartTime.Equals(infoToMerge.OccurrenceOriginalStartTime))
             {
                 throw new ArgumentOutOfRangeException("infoToMerge", "Two RUMs for different occurrences cannot be merged with each other.");
             }
         }
         if (this.IsNullOp)
         {
             throw new ArgumentException("Cannot merge a NullOp RUM info with a non-NullOp RUM info.", "infoToMerge");
         }
         if (this.Type != infoToMerge.Type)
         {
             throw new ArgumentException("Two RUMs of different types cannot be merged with each other.", "infoToMerge");
         }
     }
 }
コード例 #7
0
 private void Initialize(RumInfo info)
 {
     this.info = info;
 }
コード例 #8
0
        internal void AdjustRumMessage(MailboxSession mailboxSession, MessageItem message, RumInfo rumInfo, string textToInject, bool skipBodyUpdate = false)
        {
            this.AdjustInfoTypeSpecificProperties(message, textToInject, skipBodyUpdate);
            AppointmentAuxiliaryFlags?valueAsNullable = message.GetValueAsNullable <AppointmentAuxiliaryFlags>(MeetingMessageSchema.AppointmentAuxiliaryFlags);

            message[MeetingMessageSchema.AppointmentAuxiliaryFlags] = ((valueAsNullable != null) ? (valueAsNullable.Value | AppointmentAuxiliaryFlags.RepairUpdateMessage) : AppointmentAuxiliaryFlags.RepairUpdateMessage);
            message.Sender = this.InternalGetRumSender(mailboxSession);
            message.From   = new Participant(mailboxSession.MailboxOwner);
        }
コード例 #9
0
        public static MeetingInquiryMessage Create(MailboxSession session, StoreId parentFolderId, RumInfo rumInfo)
        {
            MeetingInquiryMessage meetingInquiryMessage = null;
            bool flag = false;

            try
            {
                meetingInquiryMessage = ItemBuilder.CreateNewItem <MeetingInquiryMessage>(session, parentFolderId, ItemCreateInfo.MeetingInquiryInfo);
                meetingInquiryMessage.LocationIdentifierHelperInstance.SetLocationIdentifier(39191U, LastChangeAction.Create);
                meetingInquiryMessage[StoreObjectSchema.ItemClass] = "IPM.Schedule.Inquiry";
                RumDecorator rumDecorator = RumDecorator.CreateInstance(rumInfo);
                rumDecorator.AdjustRumMessage(meetingInquiryMessage.MailboxSession, meetingInquiryMessage, rumInfo, null, false);
                flag = true;
            }
            finally
            {
                if (!flag && meetingInquiryMessage != null)
                {
                    meetingInquiryMessage.Dispose();
                }
            }
            return(meetingInquiryMessage);
        }