protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag)
        {
            IDictionary <RecipientItemType, HashSet <IParticipant> > recipients = null;

            if (ReplyAllParticipantsProperty.Extractor.ShouldExtract(propertyBag))
            {
                IList <IParticipant> replyTo;
                if (ReplyAllParticipantsProperty.Extractor.Extract(propertyBag, (Participant participant) => participant, this.ParticipantRepresentationComparer, out recipients, out replyTo))
                {
                    IParticipant simpleParticipant  = base.GetSimpleParticipant(InternalSchema.Sender, propertyBag);
                    IParticipant simpleParticipant2 = base.GetSimpleParticipant(InternalSchema.From, propertyBag);
                    return(ReplyAllParticipantsRepresentationProperty <IParticipant> .BuildReplyAllRecipients <IParticipant>(simpleParticipant, simpleParticipant2, replyTo, recipients, this.ParticipantRepresentationComparer));
                }
            }
            return(ReplyAllParticipantsRepresentationProperty <IParticipant> .InstantiateResultType(this.ParticipantRepresentationComparer));
        }
Exemplo n.º 2
0
        public static IDictionary <RecipientItemType, HashSet <RepType> > BuildToAndCCRecipients <RepType>(IDictionary <RecipientItemType, HashSet <RepType> > recipients, IEqualityComparer <RepType> participantRepresentationComparer)
        {
            IDictionary <RecipientItemType, HashSet <RepType> > dictionary = ReplyAllParticipantsRepresentationProperty <RepType> .InstantiateResultType(participantRepresentationComparer);

            foreach (KeyValuePair <RecipientItemType, HashSet <RepType> > keyValuePair in recipients)
            {
                if (keyValuePair.Key == RecipientItemType.To || keyValuePair.Key == RecipientItemType.Cc)
                {
                    foreach (RepType item in keyValuePair.Value)
                    {
                        dictionary[keyValuePair.Key].Add(item);
                    }
                }
            }
            dictionary[RecipientItemType.Cc].ExceptWith(dictionary[RecipientItemType.To]);
            return(dictionary);
        }