Esempio n. 1
0
        public PartialResultsCollection GetPartialResults(LdapPartialAsyncResult asyncResult)
        {
            lock (this)
            {
                if (!_resultList.Contains(asyncResult))
                {
                    throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, SR.InvalidAsyncResult));
                }

                if (asyncResult.exception != null)
                {
                    // remove this async operation

                    // the async operation basically failed, we won't do it any more, so throw exception to the user and remove it from the list
                    _resultList.Remove(asyncResult);
                    throw asyncResult.exception;
                }

                PartialResultsCollection collection = new PartialResultsCollection();

                if (asyncResult.response != null)
                {
                    if (asyncResult.response.Entries != null)
                    {
                        for (int i = 0; i < asyncResult.response.Entries.Count; i++)
                        {
                            collection.Add(asyncResult.response.Entries[i]);
                        }

                        asyncResult.response.Entries.Clear();
                    }

                    if (asyncResult.response.References != null)
                    {
                        for (int i = 0; i < asyncResult.response.References.Count; i++)
                        {
                            collection.Add(asyncResult.response.References[i]);
                        }

                        asyncResult.response.References.Clear();
                    }
                }

                return(collection);
            }
        }
        public PartialResultsCollection GetPartialResults(LdapPartialAsyncResult asyncResult)
        {
            PartialResultsCollection partialResultsCollection;

            lock (this)
            {
                if (this.resultList.Contains(asyncResult))
                {
                    if (asyncResult.exception == null)
                    {
                        PartialResultsCollection partialResultsCollection1 = new PartialResultsCollection();
                        if (asyncResult.response != null)
                        {
                            if (asyncResult.response.Entries != null)
                            {
                                for (int i = 0; i < asyncResult.response.Entries.Count; i++)
                                {
                                    partialResultsCollection1.Add(asyncResult.response.Entries[i]);
                                }
                                asyncResult.response.Entries.Clear();
                            }
                            if (asyncResult.response.References != null)
                            {
                                for (int j = 0; j < asyncResult.response.References.Count; j++)
                                {
                                    partialResultsCollection1.Add(asyncResult.response.References[j]);
                                }
                                asyncResult.response.References.Clear();
                            }
                        }
                        partialResultsCollection = partialResultsCollection1;
                    }
                    else
                    {
                        this.resultList.Remove(asyncResult);
                        throw asyncResult.exception;
                    }
                }
                else
                {
                    throw new ArgumentException(Res.GetString("InvalidAsyncResult"));
                }
            }
            return(partialResultsCollection);
        }
 public PartialResultsCollection GetPartialResults(LdapPartialAsyncResult asyncResult)
 {
     lock (this)
     {
         if (!this.resultList.Contains(asyncResult))
         {
             throw new ArgumentException(Res.GetString("InvalidAsyncResult"));
         }
         if (asyncResult.exception != null)
         {
             this.resultList.Remove(asyncResult);
             throw asyncResult.exception;
         }
         PartialResultsCollection resultss = new PartialResultsCollection();
         if (asyncResult.response != null)
         {
             if (asyncResult.response.Entries != null)
             {
                 for (int i = 0; i < asyncResult.response.Entries.Count; i++)
                 {
                     resultss.Add(asyncResult.response.Entries[i]);
                 }
                 asyncResult.response.Entries.Clear();
             }
             if (asyncResult.response.References != null)
             {
                 for (int j = 0; j < asyncResult.response.References.Count; j++)
                 {
                     resultss.Add(asyncResult.response.References[j]);
                 }
                 asyncResult.response.References.Clear();
             }
         }
         return resultss;
     }
 }
 public LdapException(string message, Exception inner) : base(message, inner)
 {
     this.results = new PartialResultsCollection();
 }
 protected LdapException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this.results = new PartialResultsCollection();
 }
 public LdapException(int errorCode) : base(Res.GetString("DefaultLdapError"))
 {
     this.results = new PartialResultsCollection();
     this.errorCode = errorCode;
 }
 public LdapException()
 {
     this.results = new PartialResultsCollection();
 }
Esempio n. 8
0
 public LdapException(int errorCode, string message, string serverErrorMessage) : base(message)
 {
     this.results            = new PartialResultsCollection();
     this.errorCode          = errorCode;
     this.serverErrorMessage = serverErrorMessage;
 }
Esempio n. 9
0
 public LdapException(int errorCode, string message, Exception inner) : base(message, inner)
 {
     this.results   = new PartialResultsCollection();
     this.errorCode = errorCode;
 }
Esempio n. 10
0
 public LdapException(int errorCode)
     : this()
 {
     ErrorCode      = errorCode;
     PartialResults = new PartialResultsCollection();
 }
Esempio n. 11
0
 protected LdapException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this.results = new PartialResultsCollection();
 }
Esempio n. 12
0
 public LdapException(int errorCode) : base(Res.GetString("DefaultLdapError"))
 {
     this.results   = new PartialResultsCollection();
     this.errorCode = errorCode;
 }
Esempio n. 13
0
 public LdapException()
 {
     this.results = new PartialResultsCollection();
 }
        public PartialResultsCollection GetPartialResults(LdapPartialAsyncResult asyncResult)
        {
            lock (this)
            {
                if (!_resultList.Contains(asyncResult))
                    throw new ArgumentException(Res.GetString(Res.InvalidAsyncResult));

                if (asyncResult.exception != null)
                {
                    // remove this async operation

                    // the async operation basically failed, we won't do it any more, so throw exception to the user and remove it from the list
                    _resultList.Remove(asyncResult);
                    throw asyncResult.exception;
                }

                PartialResultsCollection collection = new PartialResultsCollection();

                if (asyncResult.response != null)
                {
                    if (asyncResult.response.Entries != null)
                    {
                        for (int i = 0; i < asyncResult.response.Entries.Count; i++)
                            collection.Add(asyncResult.response.Entries[i]);

                        asyncResult.response.Entries.Clear();
                    }

                    if (asyncResult.response.References != null)
                    {
                        for (int i = 0; i < asyncResult.response.References.Count; i++)
                            collection.Add(asyncResult.response.References[i]);

                        asyncResult.response.References.Clear();
                    }
                }

                return collection;
            }
        }
 public LdapException(int errorCode, string message, Exception inner) : base(message, inner)
 {
     this.results = new PartialResultsCollection();
     this.errorCode = errorCode;
 }
Esempio n. 16
0
 public LdapException(string message, Exception inner) : base(message, inner)
 {
     this.results = new PartialResultsCollection();
 }
 public LdapException(int errorCode, string message, string serverErrorMessage) : base(message)
 {
     this.results = new PartialResultsCollection();
     this.errorCode = errorCode;
     this.serverErrorMessage = serverErrorMessage;
 }
Esempio n. 18
0
		public LdapException (int errorCode)
			: this ()
		{
			ErrorCode = errorCode;
			PartialResults = new PartialResultsCollection ();
		}