public Dictionary <IConversationTreeNode, ParticipantSet> LoadAddedParticipants(IConversationTree conversationTree)
        {
            Dictionary <IConversationTreeNode, ParticipantSet> participantsPerNode = new Dictionary <IConversationTreeNode, ParticipantSet>(ConversationTreeNodeBase.EqualityComparer);

            conversationTree.ExecuteSortedAction(ConversationTreeSortOrder.ChronologicalAscending, delegate(ConversationTreeSortOrder param0)
            {
                ParticipantSet participantSet = new ParticipantSet();
                foreach (IConversationTreeNode conversationTreeNode in conversationTree)
                {
                    ParticipantSet participantSet2 = this.LoadReplyAllParticipantsImpl(conversationTree, new IConversationTreeNode[]
                    {
                        conversationTreeNode
                    }, InternalSchema.ReplyDisplayNames);
                    ParticipantSet participantSet3 = new ParticipantSet();
                    foreach (IParticipant participant in participantSet2)
                    {
                        if (participantSet.Add(participant))
                        {
                            participantSet3.Add(participant);
                        }
                    }
                    if (participantSet3.Any <IParticipant>())
                    {
                        participantsPerNode.Add(conversationTreeNode, participantSet3);
                    }
                    participantSet.UnionWith(this.LoadFrom(conversationTree, conversationTreeNode));
                }
            });
            return(participantsPerNode);
        }
        private string GenerateParticipantsHash(IStorePropertyBag propertyBag, out ParticipantSet participants)
        {
            participants = this.replyAllExtractor.RetrieveReplyAllParticipants(propertyBag);
            List <string> list = new List <string>(participants.Count);

            foreach (IParticipant participant in participants)
            {
                list.Add(participant.DisplayName.ToLower());
            }
            StringBuilder stringBuilder = new StringBuilder(list.Count * 255);

            list.Sort(StringComparer.InvariantCultureIgnoreCase);
            foreach (string value in list)
            {
                stringBuilder.Append(value);
                stringBuilder.Append(";");
            }
            string result;

            using (SHA256CryptoServiceProvider sha256CryptoServiceProvider = new SHA256CryptoServiceProvider())
            {
                result = Convert.ToBase64String(sha256CryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(stringBuilder.ToString())));
            }
            return(result);
        }
        private ParticipantSet LoadReplyAllParticipantsImpl(IConversationTree conversationTree, ICollection <IConversationTreeNode> nodes, SmartPropertyDefinition propertyDefinition)
        {
            ParticipantSet   participantSet   = new ParticipantSet();
            ParticipantTable participantTable = this.LoadReplyAllParticipantsPerTypeImpl(conversationTree, nodes, propertyDefinition);

            participantSet.UnionWith(participantTable[RecipientItemType.To]);
            participantSet.UnionWith(participantTable[RecipientItemType.Cc]);
            return(participantSet);
        }
Exemple #4
0
        private bool CheckParticipantsRemovedUsingParticipants(IConversationAggregationLogger logger, ICorePropertyBag deliveredItemPropertyBag, IStorePropertyBag parentItemPropertyBag)
        {
            ParticipantSet participantSet  = this.ReplyAllExtractor.RetrieveReplyAllParticipants(deliveredItemPropertyBag);
            ParticipantSet participantSet2 = this.ReplyAllExtractor.RetrieveReplyAllParticipants(parentItemPropertyBag);
            bool           flag            = !participantSet2.IsSubsetOf(participantSet);

            if (flag)
            {
                logger.LogSideConversationProcessingData(participantSet2, participantSet);
            }
            return(flag);
        }
        private ParticipantSet LoadParticipants(IConversationTree conversationTree, ConversationDataExtractor.ParticipantLoaderDelegate loaderDelegate, ICollection <IConversationTreeNode> nodes)
        {
            ParticipantSet participantSet = new ParticipantSet();

            nodes = (nodes ?? conversationTree.ToList <IConversationTreeNode>());
            foreach (IConversationTreeNode conversationTreeNode in nodes)
            {
                if (conversationTreeNode.HasData)
                {
                    foreach (IStorePropertyBag propertyBag in conversationTreeNode.StorePropertyBags)
                    {
                        participantSet.UnionWith(loaderDelegate(propertyBag));
                    }
                }
            }
            return(participantSet);
        }
Exemple #6
0
        private ParticipantSet CalculateAllRecipients()
        {
            ParticipantSet participantSet = new ParticipantSet();

            foreach (PropertyDefinition propertyDefinition in MessageItemSchema.SingleRecipientProperties)
            {
                if (this.loadedProperties.Contains(propertyDefinition))
                {
                    Participant valueOrDefault = this.StorePropertyBag.GetValueOrDefault <Participant>(propertyDefinition, null);
                    if (valueOrDefault != null)
                    {
                        participantSet.Add(valueOrDefault);
                    }
                }
            }
            participantSet.UnionWith(this.Recipients.ToList());
            participantSet.UnionWith(this.ReplyToParticipants);
            return(participantSet);
        }
        public ParticipantSet CalculateAllRecipients(IConversationTree conversationTree, ICollection <IConversationTreeNode> loadedNodes)
        {
            loadedNodes = (loadedNodes ?? conversationTree);
            HashSet <StoreObjectId> hashSet = new HashSet <StoreObjectId>(from node in loadedNodes
                                                                          select node.MainStoreObjectId);

            if (!this.ConversationDataLoaded)
            {
                this.LoadItemPartsOrBodySummaries(conversationTree, hashSet);
            }
            ParticipantSet participantSet = new ParticipantSet();

            foreach (StoreObjectId itemId in hashSet)
            {
                ItemPart itemPart = this.GetItemPart(conversationTree, itemId);
                participantSet.UnionWith(itemPart.AllRecipients);
            }
            return(participantSet);
        }