Пример #1
0
 private static void ValidateProperties(ABPropertyDefinitionCollection properties)
 {
     if (properties == null)
     {
         throw new ArgumentNullException("properties");
     }
 }
Пример #2
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);
        }
Пример #3
0
        public ABRawEntry FindByLegacyExchangeDN(string legacyDN, ABPropertyDefinitionCollection properties)
        {
            if (string.IsNullOrEmpty(legacyDN))
            {
                throw new ArgumentNullException("legacyDN");
            }
            ABSession.ValidateProperties(properties);
            this.ThrowIfDisposed();
            this.Tracer.TraceDebug <string, ABPropertyDefinitionCollection>(0L, "FindByLegacyExchangeDN(id={0}, properties={1})", legacyDN, properties);
            string[] legacyDNs = new string[]
            {
                legacyDN
            };
            IList <ABRawEntry> list = this.InternalFindByLegacyExchangeDNs(legacyDNs, 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 FindByLegacyDN({1}).", new object[]
                {
                    list.Count,
                    legacyDN
                }));
            }
            if (list.Count != 0)
            {
                return(list[0]);
            }
            return(null);
        }
Пример #4
0
        protected virtual ABRawEntry InternalFindById(ABObjectId id, ABPropertyDefinitionCollection properties)
        {
            ABObject abobject = this.InternalFindById(id);

            if (abobject != null)
            {
                abobject.PropertyDefinitionCollection = properties;
            }
            return(abobject);
        }
Пример #5
0
 // Token: 0x06000001 RID: 1 RVA: 0x000020D0 File Offset: 0x000002D0
 protected ABRawEntry(ABSession ownerSession, ABPropertyDefinitionCollection propertyDefinitionCollection)
 {
     if (ownerSession == null)
     {
         throw new ArgumentNullException("ownerSession");
     }
     if (propertyDefinitionCollection == null)
     {
         throw new ArgumentNullException("propertyDefinitionCollection");
     }
     this.ownerSession = ownerSession;
     this.propertyDefinitionCollection = propertyDefinitionCollection;
 }
Пример #6
0
        public IList <ABRawEntry> FindByIds(ICollection <ABObjectId> ids, ABPropertyDefinitionCollection properties)
        {
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }
            if (ids.Count == 0)
            {
                throw new ArgumentException("ids collection can't be empty.");
            }
            ABSession.ValidateProperties(properties);
            this.ThrowIfDisposed();
            this.Tracer.TraceDebug <int, ABPropertyDefinitionCollection>(0L, "FindByIds({0} ids, properties={1})", ids.Count, properties);
            IList <ABRawEntry> list = this.InternalFindByIds(ids, properties);

            this.Tracer.TraceDebug <int>(0L, "Provider returned '{0}' results.", list.Count);
            return(list);
        }
Пример #7
0
        public IList <ABRawEntry> FindByANR(string anrMatch, int maxResults, ABPropertyDefinitionCollection properties)
        {
            if (string.IsNullOrEmpty(anrMatch))
            {
                throw new ArgumentNullException("anrMatch");
            }
            if (maxResults < 1)
            {
                throw new ArgumentOutOfRangeException("maxResults", "maxResults must be greater than 0 and smaller than or equal to " + 1000.ToString());
            }
            if (maxResults > 1000)
            {
                maxResults = 1000;
            }
            ABSession.ValidateProperties(properties);
            this.ThrowIfDisposed();
            this.Tracer.TraceDebug <string, int, ABPropertyDefinitionCollection>(0L, "FindByAnr({0}, {1}, {2})", anrMatch, maxResults, properties);
            IList <ABRawEntry> list = this.InternalFindByANR(anrMatch, maxResults, properties);

            if (list == null)
            {
                list = ABSession.emptyRawEntriesReadOnlyList;
            }
            else if (list.Count > maxResults)
            {
                string message = string.Format(CultureInfo.InvariantCulture, "Provider '{0}' returned '{1}' rather than '{2}' maximum results.", new object[]
                {
                    this.ProviderName,
                    list.Count,
                    maxResults
                });
                this.Tracer.TraceError(0L, message);
                throw new InvalidOperationException(message);
            }
            this.Tracer.TraceDebug <int>(0L, "Provider returned '{0}' results.", list.Count);
            return(list);
        }
Пример #8
0
        protected virtual IList <ABRawEntry> InternalFindByIds(ICollection <ABObjectId> ids, ABPropertyDefinitionCollection properties)
        {
            IList <ABRawEntry> list = new List <ABRawEntry>(ids.Count);

            foreach (ABObjectId id in ids)
            {
                list.Add(this.InternalFindById(id, properties));
            }
            return(list);
        }
Пример #9
0
        protected virtual IList <ABRawEntry> InternalFindByLegacyExchangeDNs(ICollection <string> legacyDNs, ABPropertyDefinitionCollection properties)
        {
            IList <ABRawEntry> list = new List <ABRawEntry>(legacyDNs.Count);

            foreach (string legacyExchangeDN in legacyDNs)
            {
                list.Add(this.InternalFindByLegacyExchangeDN(legacyExchangeDN, properties));
            }
            return(list);
        }
Пример #10
0
        protected virtual ABRawEntry InternalFindByLegacyExchangeDN(string legacyExchangeDN, ABPropertyDefinitionCollection properties)
        {
            ABObject abobject = this.InternalFindByLegacyExchangeDN(legacyExchangeDN);

            if (abobject != null)
            {
                abobject.PropertyDefinitionCollection = properties;
            }
            return(abobject);
        }
Пример #11
0
        protected virtual List <ABRawEntry> InternalFindByANR(string anrMatch, int maxResults, ABPropertyDefinitionCollection properties)
        {
            List <ABObject>   list  = this.InternalFindByANR(anrMatch, maxResults);
            List <ABRawEntry> list2 = new List <ABRawEntry>(list.Count);

            foreach (ABObject abobject in list)
            {
                if (abobject != null)
                {
                    abobject.PropertyDefinitionCollection = properties;
                    list2.Add(abobject);
                }
            }
            return(list2);
        }
Пример #12
0
        public IList <ABRawEntry> FindByLegacyExchangeDNs(ICollection <string> legacyDNs, ABPropertyDefinitionCollection properties)
        {
            if (legacyDNs == null)
            {
                throw new ArgumentNullException("legacyDNs");
            }
            if (legacyDNs.Count == 0)
            {
                throw new ArgumentException("LegacyDNs collection can't be empty.");
            }
            ABSession.ValidateProperties(properties);
            this.ThrowIfDisposed();
            this.Tracer.TraceDebug <int, ABPropertyDefinitionCollection>(0L, "FindByLegacyExchangeDNs({0} legacyDNs, properties={1})", legacyDNs.Count, properties);
            IList <ABRawEntry> list = this.InternalFindByLegacyExchangeDNs(legacyDNs, properties);

            this.Tracer.TraceDebug <int>(0L, "Provider returned '{0}' results.", list.Count);
            return(list);
        }
Пример #13
0
 protected ABObject(ABSession ownerSession, ABPropertyDefinitionCollection properties) : base(ownerSession, properties)
 {
 }