public IEnumerator <IStorePropertyBag> GetEnumerator()
 {
     foreach (PropertyDefinition property in ContactsByEmailAddressEnumerator.EmailAddressSearchProperties)
     {
         IEnumerable <IStorePropertyBag> contactsEnumerator = new ContactsByPropertyValueEnumerator(this.contactsFolder, property, this.emailAddresses, this.requestedProperties);
         foreach (IStorePropertyBag storePropertyBag in contactsEnumerator)
         {
             yield return(storePropertyBag);
         }
     }
     yield break;
 }
Exemplo n.º 2
0
        public override IEnumerable <ContactInfoForLinking> GetAllContactsPerCriteria(IEnumerable <string> emailAddresses, string imAddress)
        {
            List <ContactInfoForLinking>        list = new List <ContactInfoForLinking>(10);
            IEnumerable <ContactInfoForLinking> result;

            using (IFolder folder = new XSOFactory().BindToFolder(this.MailboxSession, DefaultFolderType.MyContacts))
            {
                IEnumerable <IStorePropertyBag> enumerable = new ContactsByEmailAddressEnumerator(folder, ContactInfoForLinking.Properties, emailAddresses);
                foreach (IStorePropertyBag propertyBag in enumerable)
                {
                    list.Add(base.CreateContactInfoForLinking(propertyBag));
                }
                enumerable = new ContactsByPropertyValueEnumerator(folder, InternalSchema.IMAddress, this.GetIMAddressWithVariation(imAddress), ContactInfoForLinking.Properties);
                foreach (IStorePropertyBag propertyBag2 in enumerable)
                {
                    list.Add(base.CreateContactInfoForLinking(propertyBag2));
                }
                result = list;
            }
            return(result);
        }