Exemplo n.º 1
0
 public static Win32Exception GetWin32Exception(SystemErrorCode errorCode)
 {
     switch (errorCode)
     {
         case SystemErrorCode.ErrorAccessDenied:
             return new AccessDeniedException();
         default:
             return new Win32Exception((int)errorCode);
     }
 }
Exemplo n.º 2
0
        public static Win32Exception GetWin32Exception(SystemErrorCode errorCode)
        {
            switch (errorCode)
            {
            case SystemErrorCode.ErrorAccessDenied:
                return(new AccessDeniedException());

            default:
                return(new Win32Exception((int)errorCode));
            }
        }
Exemplo n.º 3
0
 public static string Description(this SystemErrorCode errorCode)
 {
     return(new Win32Exception((int)errorCode).Message);
 }