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>");
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            string parameter = base.GetParameter("id", true);

            this.searchWords    = base.GetParameter("sw", false);
            this.conversationId = OwaStoreObjectId.CreateFromString(parameter);
            this.conversation   = ConversationUtilities.LoadConversation(base.UserContext, this.conversationId, ItemPartWriter.GetRequestedProperties());
            this.conversation.TrimToNewest(Globals.MaxItemsInConversationReadingPane);
            MailboxSession mailboxSession = (MailboxSession)this.conversationId.GetSession(base.UserContext);

            this.sentItemsFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.SentItems);
            this.localItemIds      = ConversationUtilities.GetLocalItemIds(mailboxSession, this.conversation, this.conversationId.ParentFolderId);
            base.OwaContext.ShouldDeferInlineImages = !base.IsInOEHResponse;
            this.conversation.OnBeforeItemLoad     += ItemPartWriter.OnBeforeItemLoad;
        }
示例#4
0
        public void Refresh()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "ReadConversationEventHandler.Refresh");
            OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("CnvId");

            OwaStoreObjectId[] expandedIds    = (OwaStoreObjectId[])base.GetParameter("ExpIds");
            int[]        expandedInternetMIds = (int[])base.GetParameter("ExpInternetMIds");
            Conversation conversation         = ConversationUtilities.LoadConversation(base.UserContext, owaStoreObjectId, ItemPartWriter.GetRequestedProperties());

            conversation.TrimToNewest(Globals.MaxItemsInConversationReadingPane);
            MailboxSession       session      = (MailboxSession)owaStoreObjectId.GetSession(base.UserContext);
            List <StoreObjectId> localItemIds = ConversationUtilities.GetLocalItemIds(session, conversation, owaStoreObjectId.ParentFolderId);

            conversation.OnBeforeItemLoad += ItemPartWriter.OnBeforeItemLoad;
            this.Writer.Write("<div id=divRfrsh");
            RenderingUtilities.RenderExpando(this.Writer, "iGC", ConversationUtilities.GetGlobalCount(conversation));
            RenderingUtilities.RenderExpando(this.Writer, "iC", localItemIds.Count);
            RenderingUtilities.RenderExpando(this.Writer, "iSort", (int)base.UserContext.UserOptions.ConversationSortOrder);
            this.Writer.Write(">");
            ConversationUtilities.RenderItemParts(this.Writer, base.UserContext, owaStoreObjectId, conversation, expandedIds, expandedInternetMIds, localItemIds, null, false);
            this.Writer.Write("</div>");
        }