예제 #1
0
        protected override bool ExtractToAndCC(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <string> .ParticipantConverter converter, IEqualityComparer <string> comparer, out IDictionary <RecipientItemType, HashSet <string> > recipientTable)
        {
            recipientTable = ComplexParticipantExtractorBase <string> .InstantiateResultType(comparer);

            IList <string> other;

            if (!Participant.TryGetParticipantsFromDisplayNameProperty(propertyBag, InternalSchema.DisplayToInternal, out other))
            {
                return(false);
            }
            IList <string> other2;

            if (!Participant.TryGetParticipantsFromDisplayNameProperty(propertyBag, InternalSchema.DisplayCcInternal, out other2))
            {
                return(false);
            }
            recipientTable[RecipientItemType.To].UnionWith(other);
            recipientTable[RecipientItemType.Cc].UnionWith(other2);
            return(true);
        }
        protected override bool ExtractToAndCC(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <T> .ParticipantConverter converter, IEqualityComparer <T> comparer, out IDictionary <RecipientItemType, HashSet <T> > recipientTable)
        {
            ICoreItem coreItem = propertyBag.Context.CoreObject as ICoreItem;

            recipientTable = null;
            if (coreItem != null)
            {
                CoreRecipientCollection recipientCollection = coreItem.GetRecipientCollection(true);
                if (recipientCollection != null)
                {
                    recipientTable = ComplexParticipantExtractorBase <T> .InstantiateResultType(comparer);

                    foreach (CoreRecipient coreRecipient in recipientCollection)
                    {
                        if (coreRecipient.RecipientItemType == RecipientItemType.To || coreRecipient.RecipientItemType == RecipientItemType.Cc)
                        {
                            recipientTable[coreRecipient.RecipientItemType].Add(converter(coreRecipient.Participant));
                        }
                    }
                    return(true);
                }
            }
            return(false);
        }