Esempio n. 1
0
        public ABRawEntry FindById(ABObjectId id, ABPropertyDefinitionCollection properties)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            ABSession.ValidateProperties(properties);
            this.ThrowIfDisposed();
            this.Tracer.TraceDebug <ABObjectId, ABPropertyDefinitionCollection>(0L, "FindById(id={0}, properties={1})", id, properties);
            ABObjectId[] ids = new ABObjectId[]
            {
                id
            };
            IList <ABRawEntry> list = this.InternalFindByIds(ids, properties);

            this.Tracer.TraceDebug <int>(0L, "Provider returned '{0}' results.", list.Count);
            if (list.Count > 1)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Provider returned {0} results for FindById({1}).", new object[]
                {
                    list.Count,
                    id
                }));
            }
            if (list.Count != 0)
            {
                return(list[0]);
            }
            return(null);
        }
Esempio n. 2
0
        protected virtual ABRawEntry InternalFindById(ABObjectId id, ABPropertyDefinitionCollection properties)
        {
            ABObject abobject = this.InternalFindById(id);

            if (abobject != null)
            {
                abobject.PropertyDefinitionCollection = properties;
            }
            return(abobject);
        }
Esempio n. 3
0
        public ABObject FindById(ABObjectId id)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            this.ThrowIfDisposed();
            this.Tracer.TraceDebug <ABObjectId>(0L, "FindById ({0})", id);
            ABObject abobject = this.InternalFindById(id);

            this.TraceForObjectAfterFind(abobject);
            return(abobject);
        }
Esempio n. 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));
        }
Esempio n. 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));
        }
Esempio n. 6
0
 protected abstract ABObject InternalFindById(ABObjectId id);