Пример #1
0
 internal static void ThrowExceptionForResultCodeError(ResultCode resultCode, string message, string serverErrorMessage, Exception innerException)
 {
     if (resultCode != ResultCode.Success)
     {
         throw ExceptionHelper.GetExceptionFromErrorCode(ADStoreAccess.MapResultCodeToErrorCode(resultCode), message, serverErrorMessage, innerException);
     }
     else
     {
         return;
     }
 }
Пример #2
0
 private void ProcessAsqResponse(ADSearchResponse response)
 {
     if (!string.IsNullOrEmpty(this._attributeScopedQuery))
     {
         DirectoryControl[] controls = response.Controls;
         int num = 0;
         while (num < (int)controls.Length)
         {
             ADAsqResponseControl aDAsqResponseControl = controls[num] as ADAsqResponseControl;
             if (aDAsqResponseControl == null)
             {
                 num++;
             }
             else
             {
                 if (aDAsqResponseControl.Result == ResultCode.Success)
                 {
                     break;
                 }
                 int            errorCode      = ADStoreAccess.MapResultCodeToErrorCode(aDAsqResponseControl.Result);
                 Win32Exception win32Exception = new Win32Exception(errorCode);
                 object[]       message        = new object[3];
                 message[0] = this._searchRoot;
                 message[1] = this._attributeScopedQuery;
                 message[2] = win32Exception.Message;
                 string str = string.Format(CultureInfo.CurrentCulture, StringResources.AsqResponseError, message);
                 throw ExceptionHelper.GetExceptionFromErrorCode(errorCode, str, null);
             }
         }
         return;
     }
     else
     {
         return;
     }
 }