public void SyncConversationTreeNodesContent(IEnumerable <IConversationTreeNode> threadNodes)
 {
     foreach (IConversationTreeNode conversationTreeNode in threadNodes)
     {
         IConversationTreeNode equivalentNodeFromConversationTree = this.GetEquivalentNodeFromConversationTree(conversationTreeNode.MainStoreObjectId);
         foreach (StoreObjectId itemId in conversationTreeNode.ToListStoreObjectId())
         {
             IStorePropertyBag bag;
             if (equivalentNodeFromConversationTree.TryGetPropertyBag(itemId, out bag))
             {
                 conversationTreeNode.UpdatePropertyBag(itemId, bag);
             }
         }
     }
 }
 private void SyncConversationTrees()
 {
     if (this.IsSingleConversationFamily)
     {
         return;
     }
     this.backwardMessagePropertyBag = null;
     this.forwardConversationRootMessagePropertyBags = null;
     foreach (IConversationTreeNode conversationTreeNode in this.selectedConversationTree)
     {
         IConversationTreeNode equivalentNodeFromFamilyTree = this.GetEquivalentNodeFromFamilyTree(conversationTreeNode);
         foreach (StoreObjectId itemId in conversationTreeNode.ToListStoreObjectId())
         {
             IStorePropertyBag bag;
             if (equivalentNodeFromFamilyTree.TryGetPropertyBag(itemId, out bag))
             {
                 conversationTreeNode.UpdatePropertyBag(itemId, bag);
             }
         }
     }
 }
        public ItemPart GetItemPart(IConversationTree conversationTree, StoreObjectId itemId)
        {
            IStorePropertyBag     propertyBag          = null;
            ItemPart              itemPart             = null;
            IConversationTreeNode conversationTreeNode = null;

            if (!conversationTree.TryGetConversationTreeNode(itemId, out conversationTreeNode) || !conversationTreeNode.TryGetPropertyBag(itemId, out propertyBag))
            {
                throw new ArgumentException("No ConversationTreeNode/PropertyBag can be found for the passed StoreObjectId");
            }
            if (!this.itemParts.TryGetValue(itemId, out itemPart))
            {
                this.LoadItemPart(conversationTree, propertyBag);
                itemPart = this.loadedItemParts[itemId];
            }
            if (itemPart is LoadedItemPart && !itemPart.DidLoadSucceed)
            {
                return(itemPart);
            }
            if (itemPart.UniqueFragmentInfo == null)
            {
                LoadedItemPart loadedItemPart = (LoadedItemPart)itemPart;
                ExtractionData extractionData;
                if (!this.CanSkipDiffing(conversationTree, loadedItemPart, out extractionData))
                {
                    BodyFragmentInfo parentBodyFragment = null;
                    if (conversationTreeNode.ParentNode.HasData)
                    {
                        StoreObjectId mainStoreObjectId = conversationTreeNode.ParentNode.MainStoreObjectId;
                        if (this.treeNodeBodyFragment.ContainsKey(mainStoreObjectId))
                        {
                            parentBodyFragment = this.treeNodeBodyFragment[mainStoreObjectId].Key;
                        }
                        else
                        {
                            LoadedItemPart loadedItemPart2 = null;
                            if (!this.loadedItemParts.TryGetValue(mainStoreObjectId, out loadedItemPart2))
                            {
                                IStorePropertyBag propertyBag2;
                                if (!conversationTreeNode.ParentNode.TryGetPropertyBag(mainStoreObjectId, out propertyBag2))
                                {
                                    throw new ArgumentException("No Property bag can be found for the passed StoreObjectId on the ParentNode");
                                }
                                this.LoadItemPart(conversationTree, propertyBag2);
                                loadedItemPart2 = this.loadedItemParts[mainStoreObjectId];
                            }
                            parentBodyFragment = loadedItemPart2.BodyFragmentInfo;
                        }
                    }
                    ConversationDataExtractor.DiffItemParts(parentBodyFragment, loadedItemPart);
                }
                else
                {
                    itemPart.UniqueFragmentInfo     = extractionData.ChildUniqueBody;
                    itemPart.DisclaimerFragmentInfo = extractionData.ChildDisclaimer;
                }
            }
            return(itemPart);
        }