Exemplo n.º 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);
        }
Exemplo n.º 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));
 }
Exemplo n.º 5
0
 protected abstract bool ExtractToAndCC(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <T> .ParticipantConverter converter, IEqualityComparer <T> comparer, out IDictionary <RecipientItemType, HashSet <T> > recipientTable);
Exemplo n.º 6
0
 protected abstract bool ExtractReplyTo(PropertyBag.BasicPropertyStore propertyBag, ComplexParticipantExtractorBase <T> .ParticipantConverter converter, out IList <T> replyToRecipients);
Exemplo n.º 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));
 }
Exemplo n.º 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)));
 }
Exemplo n.º 9
0
        private static bool CanExtractRecipients(PropertyBag.BasicPropertyStore propertyBag)
        {
            string itemClass = propertyBag.GetValue(InternalSchema.ItemClass) as string;

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

            return(ComplexParticipantExtractorBase <T> .CanExtractRecipients(itemClass));
        }
Exemplo n.º 11
0
 public virtual bool ShouldExtract(PropertyBag.BasicPropertyStore propertyBag)
 {
     return(ComplexParticipantExtractorBase <T> .CanExtractRecipients(propertyBag));
 }