コード例 #1
0
        // Token: 0x06002E1D RID: 11805 RVA: 0x001074AC File Offset: 0x001056AC
        private OwaStoreObjectId GetLatestFlaggedOrNormalItem()
        {
            OwaStoreObjectId owaStoreObjectId = base.GetParameter("id") as OwaStoreObjectId;

            if (owaStoreObjectId == null || !owaStoreObjectId.IsConversationId)
            {
                return(owaStoreObjectId);
            }
            MailboxSession mailboxSession = (MailboxSession)owaStoreObjectId.GetSession(base.UserContext);
            Conversation   conversation   = Conversation.Load(mailboxSession, owaStoreObjectId.ConversationId, base.UserContext.IsIrmEnabled, new PropertyDefinition[]
            {
                ItemSchema.Id,
                StoreObjectSchema.ParentItemId,
                ItemSchema.ReceivedTime,
                ItemSchema.FlagStatus
            });

            conversation.ConversationTree.Sort(ConversationTreeSortOrder.ChronologicalDescending);
            IList <StoreObjectId> flagedItems = ConversationUtilities.GetFlagedItems(mailboxSession, conversation, owaStoreObjectId.ParentFolderId, new FlagStatus[]
            {
                FlagStatus.Flagged
            });

            if (flagedItems.Count > 0)
            {
                return(OwaStoreObjectId.CreateFromStoreObjectId(flagedItems[0], owaStoreObjectId));
            }
            StoreObjectId latestMessage = ConversationUtilities.GetLatestMessage(mailboxSession, conversation, owaStoreObjectId.ParentFolderId);

            if (latestMessage != null)
            {
                return(OwaStoreObjectId.CreateFromStoreObjectId(latestMessage, owaStoreObjectId));
            }
            return(null);
        }