Example #1
0
        // Token: 0x0600095F RID: 2399 RVA: 0x00036DA8 File Offset: 0x00034FA8
        private static void AddCorrespondingADPropertyToList(List <ADPropertyDefinition> activeDirectoryProperties, ABPropertyDefinition addressBookProperty)
        {
            ADPropertyDefinition adpropertyDefinition = ADABPropertyMapper.GetADPropertyDefinition(addressBookProperty);

            if (adpropertyDefinition != null)
            {
                activeDirectoryProperties.Add(adpropertyDefinition);
            }
        }
Example #2
0
        // Token: 0x0600095E RID: 2398 RVA: 0x00036D24 File Offset: 0x00034F24
        internal static ADPropertyDefinition[] ConvertToADProperties(ABPropertyDefinitionCollection properties)
        {
            object nativePropertyCollection = properties.GetNativePropertyCollection("AD");

            if (nativePropertyCollection != null)
            {
                return((ADPropertyDefinition[])nativePropertyCollection);
            }
            List <ADPropertyDefinition> list = new List <ADPropertyDefinition>(properties.Count);

            foreach (ABPropertyDefinition addressBookProperty in properties)
            {
                ADABPropertyMapper.AddCorrespondingADPropertyToList(list, addressBookProperty);
            }
            ADPropertyDefinition[] array = list.ToArray();
            properties.SetNativePropertyCollection("AD", array);
            return(array);
        }
Example #3
0
        protected override bool InternalTryGetValue(ABPropertyDefinition property, out object value)
        {
            ADPropertyDefinition adpropertyDefinition = ADABPropertyMapper.GetADPropertyDefinition(property);

            if (adpropertyDefinition != null)
            {
                return(this.rawEntry.TryGetValueWithoutDefault(adpropertyDefinition, out value));
            }
            ADABObjectId adabobjectId;

            if (property == ABObjectSchema.Id && ADABUtils.GetId(this.rawEntry, out adabobjectId))
            {
                value = adabobjectId;
                return(true);
            }
            string text;

            if (property == ABObjectSchema.EmailAddress && ADABUtils.GetEmailAddress(this.rawEntry, out text))
            {
                value = text;
                return(true);
            }
            object obj;

            if (property == ABObjectSchema.CanEmail && this.rawEntry.TryGetValueWithoutDefault(ADRecipientSchema.RecipientType, out obj))
            {
                value = ADABUtils.CanEmailRecipientType((RecipientType)obj);
                return(true);
            }
            if (property == ABGroupSchema.MembersCount)
            {
                value = null;
                return(true);
            }
            ADABObjectId adabobjectId2;

            if (property == ABGroupSchema.OwnerId && ADABUtils.GetOwnerId(this.rawEntry, out adabobjectId2))
            {
                value = adabobjectId2;
                return(true);
            }
            return(base.InternalTryGetValue(property, out value));
        }
Example #4
0
        protected override IList <ABRawEntry> InternalFindByIds(ICollection <ABObjectId> ids, ABPropertyDefinitionCollection properties)
        {
            ADObjectId[] array = new ADObjectId[ids.Count];
            int          num   = 0;

            foreach (ABObjectId abobjectId in ids)
            {
                ADABObjectId adabobjectId = (ADABObjectId)abobjectId;
                array[num++] = adabobjectId.NativeId;
            }
            Result <ADRawEntry>[] activeDirectoryRawEntries;
            try
            {
                activeDirectoryRawEntries = this.recipientSession.ReadMultiple(array, ADABPropertyMapper.ConvertToADProperties(properties));
            }
            catch (DataSourceOperationException ex)
            {
                throw new ABOperationException(ex.LocalizedString, ex);
            }
            catch (DataSourceTransientException ex2)
            {
                throw new ABTransientException(ex2.LocalizedString, ex2);
            }
            return(this.ADRawEntryResultsToABRawEntries(properties, activeDirectoryRawEntries));
        }
Example #5
0
        protected override ABRawEntry InternalFindById(ABObjectId id, ABPropertyDefinitionCollection properties)
        {
            ADABObjectId adabobjectId = (ADABObjectId)id;
            ADRawEntry   rawEntry;

            try
            {
                rawEntry = this.recipientSession.ReadADRawEntry(adabobjectId.NativeId, ADABPropertyMapper.ConvertToADProperties(properties));
            }
            catch (DataSourceOperationException ex)
            {
                throw new ABOperationException(ex.LocalizedString, ex);
            }
            catch (DataSourceTransientException ex2)
            {
                throw new ABTransientException(ex2.LocalizedString, ex2);
            }
            return(new ADABRawEntry(this, properties, rawEntry));
        }