예제 #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);
        }
        protected override bool ExtractReplyTo(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <T> .ParticipantConverter converter, out IList <T> replyToRecipients)
        {
            ReplyTo first = new ReplyTo((PropertyBag)propertyBag);

            replyToRecipients = new List <T>(from participant in first
                                             select converter(participant));
            return(true);
        }
예제 #4
0
 protected override bool ExtractReplyTo(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <string> .ParticipantConverter converter, out IList <string> replyToRecipients)
 {
     return(Participant.TryGetParticipantsFromDisplayNameProperty(propertyBag, ComplexParticipantExtractorFromPropertyBag.ReplyToNamesPropertyDefinition, out replyToRecipients));
 }
예제 #5
0
 protected abstract bool ExtractToAndCC(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <T> .ParticipantConverter converter, IEqualityComparer <T> comparer, out IDictionary <RecipientItemType, HashSet <T> > recipientTable);
예제 #6
0
 protected abstract bool ExtractReplyTo(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <T> .ParticipantConverter converter, out IList <T> replyToRecipients);
예제 #7
0
 public bool Extract(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <T> .ParticipantConverter converter, IEqualityComparer <T> comparer, out IDictionary <RecipientItemType, HashSet <T> > recipientTable)
 {
     return(this.ExtractToAndCC(propertyBag, converter, comparer, out recipientTable));
 }
예제 #8
0
 public bool Extract(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <T> .ParticipantConverter converter, IEqualityComparer <T> comparer, out IDictionary <RecipientItemType, HashSet <T> > recipientTable, out IList <T> replyToRecipients)
 {
     replyToRecipients = null;
     recipientTable    = null;
     return(this.ExtractToAndCC(propertyBag, converter, comparer, out recipientTable) && (!this.CanExtractReplyTo(propertyBag) || this.ExtractReplyTo(propertyBag, converter, out replyToRecipients)));
 }
예제 #9
0
        private static bool CanExtractRecipients(PropertyBag.BasicPropertyStore propertyBag)
        {
            string itemClass = propertyBag.GetValue(InternalSchema.ItemClass) as string;

            return(ComplexParticipantExtractorBase <T> .CanExtractRecipients(itemClass));
        }
예제 #10
0
        public static bool CanExtractRecipients(ICorePropertyBag propertyBag)
        {
            string itemClass = propertyBag.TryGetProperty(InternalSchema.ItemClass) as string;

            return(ComplexParticipantExtractorBase <T> .CanExtractRecipients(itemClass));
        }
예제 #11
0
 public virtual bool ShouldExtract(PropertyBag.BasicPropertyStore propertyBag)
 {
     return(ComplexParticipantExtractorBase <T> .CanExtractRecipients(propertyBag));
 }