Succeeded() public static method

public static Succeeded ( int hr ) : bool
hr int
return bool
示例#1
0
 // Set the error code only if there is an error (i.e. nativeError >= 0). Otherwise the code ----s up on deserialization
 // as the Exception..ctor() throws on setting HResult to 0. The default for HResult is -2147467259.
 private void SetErrorCodeOnError(int nativeError)
 {
     if (!WebSocketProtocolComponent.Succeeded(nativeError))
     {
         this.HResult = nativeError;
     }
 }
示例#2
0
 /// <summary>Creates an instance of the <see cref="T:System.Net.WebSockets.WebSocketException" /> class.</summary>
 /// <param name="nativeError">The native error code for the exception.</param>
 /// <param name="innerException">Indicates the previous exception that led to the current exception.</param>
 public WebSocketException(int nativeError, Exception innerException)
     : base(SR.GetString("net_WebSockets_Generic"), innerException)
 {
     this.m_WebSocketErrorCode = !WebSocketProtocolComponent.Succeeded(nativeError) ? WebSocketError.NativeError : WebSocketError.Success;
     this.SetErrorCodeOnError(nativeError);
 }
示例#3
0
 /// <summary>Creates an instance of the <see cref="T:System.Net.WebSockets.WebSocketException" /> class.</summary>
 /// <param name="nativeError">The native error code for the exception.</param>
 /// <param name="message">The description of the error.</param>
 public WebSocketException(int nativeError, string message)
     : base(nativeError, message)
 {
     this.m_WebSocketErrorCode = !WebSocketProtocolComponent.Succeeded(nativeError) ? WebSocketError.NativeError : WebSocketError.Success;
     this.SetErrorCodeOnError(nativeError);
 }