コード例 #1
0
        private Item BindToItemWithItemClass(StoreObjectId id, ICollection <PropertyDefinition> properties)
        {
            switch (id.ObjectType)
            {
            case StoreObjectType.Message:
                return(MessageItem.Bind(this.folder.Session, id, properties));

            case StoreObjectType.MeetingRequest:
                return(MeetingRequest.Bind(this.folder.Session, id, properties));

            case StoreObjectType.MeetingResponse:
                return(MeetingResponse.Bind(this.folder.Session, id, properties));

            case StoreObjectType.MeetingCancellation:
                return(MeetingCancellation.Bind(this.folder.Session, id, properties));

            case StoreObjectType.Contact:
                return(Contact.Bind(this.folder.Session, id, properties));

            case StoreObjectType.DistributionList:
                return(DistributionList.Bind(this.folder.Session, id, properties));

            case StoreObjectType.Task:
                return(Task.Bind(this.folder.Session, id, true, properties));

            case StoreObjectType.Post:
                return(PostItem.Bind(this.folder.Session, id, properties));

            case StoreObjectType.Report:
                return(ReportMessage.Bind(this.folder.Session, id, properties));
            }
            return(Item.Bind(this.folder.Session, id, properties));
        }
コード例 #2
0
        public override MessageItem CreateForward(MailboxSession session, StoreId parentFolderId, ReplyForwardConfiguration configuration)
        {
            this.CheckDisposed("CreateForward");
            Util.ThrowOnNullArgument(session, "session");
            Util.ThrowOnNullArgument(parentFolderId, "parentFolderId");
            Util.ThrowOnNullArgument(configuration, "configuration");
            ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingCancellation.CreateForward: GOID={0}", this.GlobalObjectId);
            MeetingCancellation meetingCancellation = null;
            bool        flag = false;
            MessageItem result;

            try
            {
                meetingCancellation = (base.IsSeriesMessage ? MeetingCancellation.CreateMeetingCancellationSeries(session) : MeetingCancellation.CreateMeetingCancellation(session));
                ForwardCreation forwardCreation = new ForwardCreation(this, meetingCancellation, configuration);
                forwardCreation.PopulateProperties();
                meetingCancellation.AdjustAppointmentStateFlagsForForward();
                base.LocationIdentifierHelperInstance.SetLocationIdentifier(33397U, LastChangeAction.CreateForward);
                flag   = true;
                result = meetingCancellation;
            }
            finally
            {
                if (!flag && meetingCancellation != null)
                {
                    meetingCancellation.Dispose();
                    meetingCancellation = null;
                }
            }
            return(result);
        }
コード例 #3
0
        public static MeetingCancellation CreateMeetingCancellationSeries(MailboxSession mailboxSession)
        {
            MeetingCancellation meetingCancellation = ItemBuilder.CreateNewItem <MeetingCancellation>(mailboxSession, mailboxSession.GetDefaultFolderId(DefaultFolderType.Drafts), ItemCreateInfo.MeetingCancellationSeriesInfo);

            meetingCancellation.Initialize("IPM.MeetingMessageSeries.Canceled");
            return(meetingCancellation);
        }
コード例 #4
0
 protected override void SendMeetingCancellations(MailboxSession mailboxSession, bool isToAllAttendees, IList <Attendee> removedAttendeeList, bool copyToSentItems, bool ignoreSendAsRight, CancellationRumInfo rumInfo)
 {
     if (removedAttendeeList.Count == 0)
     {
         return;
     }
     ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId, int>((long)this.GetHashCode(), "Storage.CalendarItemBase.SendMeetingCancellations: GOID={0}; users={1}", base.GlobalObjectId, removedAttendeeList.Count);
     using (MeetingCancellation meetingCancellation = base.CreateMeetingCancellation(mailboxSession, isToAllAttendees, null, null))
     {
         meetingCancellation.CopySendableParticipantsToMessage(removedAttendeeList);
         base.LocationIdentifierHelperInstance.SetLocationIdentifier(33141U, LastChangeAction.SendMeetingCancellations);
         base.SendMessage(mailboxSession, meetingCancellation, copyToSentItems, ignoreSendAsRight);
     }
 }
コード例 #5
0
        public override CalendarItemBase PreProcess(bool createNewItem, bool processExternal, int defaultReminderMinutes)
        {
            this.CheckDisposed("PreProcess");
            base.LocationIdentifierHelperInstance.SetLocationIdentifier(44661U, LastChangeAction.PreProcessMeetingMessage);
            bool             canUpdatePrincipalCalendar = true;
            CalendarItemBase calendarItemBase           = null;
            bool             flag = false;

            if (base.GetValueOrDefault <MeetingMessageType>(InternalSchema.MeetingRequestType) == MeetingMessageType.Outdated)
            {
                return(null);
            }
            try
            {
                calendarItemBase = this.GetCorrelatedItem();
                if (base.IsOutOfDate(calendarItemBase))
                {
                    base.MarkAsOutOfDate();
                    base.LocationIdentifierHelperInstance.SetLocationIdentifier(59381U, LastChangeAction.MeetingMessageOutdated);
                    return(null);
                }
                if (base.SkipMessage(processExternal, calendarItemBase))
                {
                    ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId, bool, bool>((long)this.GetHashCode(), "Storage.MeetingMessage.PreProcess: GOID={0}. Skipping meeting message processing. (ProcessExternal: {1}; IsRepairUpdateMessage: {2})", this.GlobalObjectId, processExternal, base.IsRepairUpdateMessage);
                    return(null);
                }
                CalendarProcessingSteps valueOrDefault = base.GetValueOrDefault <CalendarProcessingSteps>(InternalSchema.CalendarProcessingSteps);
                bool flag2 = (valueOrDefault & CalendarProcessingSteps.CreatedOnPrincipal) == CalendarProcessingSteps.CreatedOnPrincipal;
                bool flag3 = (valueOrDefault & CalendarProcessingSteps.UpdatedCalItem) == CalendarProcessingSteps.UpdatedCalItem;
                flag = (flag2 || flag3);
                if (flag)
                {
                    ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingMessage.PreProcess: GOID={0}. Skipping meeting message processing because it was already created.", this.GlobalObjectId);
                }
                else if (createNewItem || calendarItemBase != null)
                {
                    MeetingRequest meetingRequest = this as MeetingRequest;
                    if (meetingRequest != null)
                    {
                        flag = meetingRequest.TryUpdateCalendarItem(ref calendarItemBase, defaultReminderMinutes, canUpdatePrincipalCalendar);
                    }
                    else
                    {
                        MeetingCancellation meetingCancellation = this as MeetingCancellation;
                        if (meetingCancellation != null)
                        {
                            flag = meetingCancellation.TryUpdateCalendarItem(ref calendarItemBase, canUpdatePrincipalCalendar);
                        }
                    }
                }
                else
                {
                    ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingMessage.PreProcess: GOID={0}. Skipping new meeting request.", this.GlobalObjectId);
                }
            }
            finally
            {
                if (!flag && calendarItemBase != null)
                {
                    ExTraceGlobals.MeetingMessageTracer.Information <GlobalObjectId>((long)this.GetHashCode(), "Storage.MeetingMessage.PreProcess: GOID={0}. Disposing calendar item; preconditions failed.", this.GlobalObjectId);
                    calendarItemBase.Dispose();
                    calendarItemBase = null;
                }
            }
            return(calendarItemBase);
        }
コード例 #6
0
 protected override MeetingCancellation CreateNewMeetingCancelation(MailboxSession mailboxSession)
 {
     return(MeetingCancellation.CreateMeetingCancellationSeries(mailboxSession));
 }
コード例 #7
0
 public new static MeetingCancellation Bind(StoreSession session, StoreId storeId)
 {
     return(MeetingCancellation.Bind(session, storeId, null));
 }