コード例 #1
0
ファイル: ErrorCodes.cs プロジェクト: hsienjan/WinReform
 /// <summary>
 /// Create a new instance of <see cref="WinApiError"/>
 /// </summary>
 /// <param name="errorCode"><see cref="int"/> of the error code thrown during the WinApi call</param>
 public WinApiError(int errorCode)
 {
     if (!Enum.IsDefined(typeof(WinApiErrorType), errorCode))
     {
         throw new InvalidOperationException($"{errorCode} is not an underlying value of {typeof(WinApiErrorType)}");
     }
     Error = (WinApiErrorType)errorCode;
 }
コード例 #2
0
ファイル: ErrorCodes.cs プロジェクト: hsienjan/WinReform
 /// <summary>
 /// Create a new instance of <see cref="WinApiError"/>
 /// </summary>
 /// <param name="errorType"><see cref="WinApiErrorType"/> of the thrown error during the WinApi call</param>
 public WinApiError(WinApiErrorType errorType)
 {
     Error = errorType;
 }