Beispiel #1
0
        internal static bool GetOwnerId(ADRawEntry rawEntry, out ADABObjectId ownerId)
        {
            object obj;

            if (!rawEntry.TryGetValueWithoutDefault(ADGroupSchema.ManagedBy, out obj))
            {
                ownerId = null;
                return(false);
            }
            if (obj == null)
            {
                ownerId = null;
                return(true);
            }
            MultiValuedProperty <ADObjectId> multiValuedProperty = (MultiValuedProperty <ADObjectId>)obj;

            using (MultiValuedProperty <ADObjectId> .Enumerator enumerator = multiValuedProperty.GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    ADObjectId activeDirectoryObjectId = enumerator.Current;
                    ownerId = new ADABObjectId(activeDirectoryObjectId);
                    return(true);
                }
            }
            ownerId = null;
            return(true);
        }
Beispiel #2
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));
        }
Beispiel #3
0
        internal static bool GetId(ADRawEntry rawEntry, out ADABObjectId addressBookObjectId)
        {
            object obj;

            if (!rawEntry.TryGetValueWithoutDefault(ADObjectSchema.Id, out obj))
            {
                addressBookObjectId = null;
                return(false);
            }
            if (obj == null)
            {
                addressBookObjectId = null;
                return(true);
            }
            ADObjectId activeDirectoryObjectId = (ADObjectId)obj;

            addressBookObjectId = new ADABObjectId(activeDirectoryObjectId);
            return(true);
        }
Beispiel #4
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));
        }
Beispiel #5
0
        protected override ABObject InternalFindById(ABObjectId id)
        {
            ADABObjectId adabobjectId = (ADABObjectId)id;
            ADRecipient  recipient;

            try
            {
                recipient = this.RecipientSession.Read(adabobjectId.NativeId);
            }
            catch (DataSourceOperationException ex)
            {
                throw new ABOperationException(ex.LocalizedString, ex);
            }
            catch (DataSourceTransientException ex2)
            {
                throw new ABTransientException(ex2.LocalizedString, ex2);
            }
            return(this.RecipientToABObject(recipient));
        }