Example #1
0
        protected static MailboxSession GetCalendarMailboxSession(MeetingMessage meetingMessage)
        {
            if (!(meetingMessage.Session is MailboxSession))
            {
                throw new NotSupportedException();
            }
            MailboxSession mailboxSession = (MailboxSession)meetingMessage.Session;

            if (meetingMessage.IsDelegated())
            {
                Participant       valueOrDefault = meetingMessage.GetValueOrDefault <Participant>(InternalSchema.ReceivedRepresenting);
                ExchangePrincipal principal      = MeetingMessage.InternalGetExchangePrincipal(valueOrDefault, mailboxSession);
                mailboxSession = mailboxSession.InternalGetDelegateSessionEntry(principal, OpenBy.Internal).MailboxSession;
            }
            return(mailboxSession);
        }