public void Load()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "ConversationPartsDataSource.Load()");
            if (!base.UserHasRightToLoad)
            {
                return;
            }
            PropertyDefinition[] requestedProperties = base.GetRequestedProperties();
            MailboxSession       mailboxSession      = base.Folder.Session as MailboxSession;

            this.conversation = ConversationUtilities.LoadConversation(mailboxSession, this.conversationId, requestedProperties);
            this.conversation.TrimToNewest(Globals.MaxItemsInConversationExpansion);
            this.totalCount = this.conversation.ConversationTree.Count;
            if (this.totalCount == 0)
            {
                return;
            }
            this.conversation.ConversationTree.Sort(this.sortOrder);
            this.nodes = new IConversationTreeNode[this.totalCount];
            List <StoreObjectId> localItemIds = ConversationUtilities.GetLocalItemIds(this.conversation, base.Folder);
            int num = 0;

            foreach (IConversationTreeNode conversationTreeNode in this.conversation.ConversationTree)
            {
                ConversationUtilities.SortPropertyBags(conversationTreeNode, localItemIds, mailboxSession);
                this.nodes[num] = conversationTreeNode;
                num++;
            }
            if (0 < this.nodes.Length)
            {
                base.StartRange = 0;
                base.EndRange   = this.totalCount - 1;
            }
        }
예제 #2
0
        public void ExpandItemParts()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "ReadConversationEventHandler.ExpandItemParts");
            OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("CnvId");

            OwaStoreObjectId[]   array        = (OwaStoreObjectId[])base.GetParameter("IPId");
            Conversation         conversation = ConversationUtilities.LoadConversation(base.UserContext, owaStoreObjectId, ItemPartWriter.GetRequestedProperties());
            List <StoreObjectId> localItemIds = ConversationUtilities.GetLocalItemIds((MailboxSession)owaStoreObjectId.GetSession(base.UserContext), conversation, owaStoreObjectId.ParentFolderId);

            ConversationUtilities.MarkLocalNodes(conversation, localItemIds);
            conversation.OnBeforeItemLoad += ItemPartWriter.OnBeforeItemLoad;
            foreach (OwaStoreObjectId owaStoreObjectId2 in array)
            {
                this.SanitizingWriter.Write("<div id=\"");
                this.SanitizingWriter.Write(owaStoreObjectId2.ToString());
                this.SanitizingWriter.Write("\">");
                IConversationTreeNode conversationTreeNode;
                if (!conversation.ConversationTree.TryGetConversationTreeNode(owaStoreObjectId2.StoreObjectId, out conversationTreeNode))
                {
                    this.Writer.Write("<div id=divExp itemNotFound=1>&nbsp;</div>");
                }
                else
                {
                    MailboxSession session = (MailboxSession)owaStoreObjectId.GetSession(base.UserContext);
                    ConversationUtilities.SortPropertyBags(conversationTreeNode, localItemIds, session);
                    using (ItemPartWriter writer = ItemPartWriter.GetWriter(base.UserContext, this.Writer, owaStoreObjectId, conversation, conversationTreeNode))
                    {
                        writer.RenderExpandedItemPart(false, false, null);
                    }
                }
                this.SanitizingWriter.Write("</div>");
            }
        }