LibUsbDotNet/LibUsbDotNet/LibUsb/ErrorExtensions.cs
/// <summary>
/// Gets the function's return value (if ret &gt;= 0), or throws an error if the return value was negative
/// and indicated an error.
/// </summary>
/// <param name="error">
/// The return value to inspect.
/// </param>
/// <returns>
/// The function's return value (if ret &gt;= 0);.
/// </returns>
Gets the function's return value (if ret >= 0), or throws an error if the return value was negative
and indicated an error.
Gets the function ' s return value ( if ret > = 0 ) or throws an error if the return value was negative and indicated an error .
public static int GetValueOrThrow(this Error error)
        {
            int value = (int)error;
            if (value < 0)
            {
                throw new UsbException(error);
            }
            else
            {
                return value;
            }
        }
public static int GetValueOrThrow ( this Error error ) { int value = ( int ) error ; if ( value < 0 ) { throw new UsbException ( error ) ; } else { return value ; } }
Gets the function's return value (if ret >= 0), or throws an error if the return value was negative
and indicated an error.
Gets the function ' s return value ( if ret > = 0 ) or throws an error if the return value was negative and indicated an error .
The function's return value (if ret >= 0);.
The function ' s return value ( if ret > = 0 ) ; .
Error
this
error
The return value to inspect.
The return value to inspect .