Click or drag to resize

HResultHelper Class

[This is preliminary documentation and is subject to change.]

Helper class to create and examine custom HResult values.
Inheritance Hierarchy
SystemObject
  NerdyDuck.CodedExceptionsHResultHelper

Namespace:  NerdyDuck.CodedExceptions
Assembly:  NerdyDuck.CodedExceptions (in NerdyDuck.CodedExceptions.dll) Version: 2.0.0+2040dad
Syntax
public static class HResultHelper
View Source

The HResultHelper type exposes the following members.

Methods
  NameDescription
Public methodStatic memberCreateToString
Creates the default ToString implementation for CodedExceptions, with the optional addition of custom text.
Public methodStatic memberEnumToInt32
Returns the integer value of an enumeration value.
Public methodStatic memberGetBaseHResult
Gets the HRESULT base value for the specified facility identifier.
Public methodStatic memberGetErrorId
Gets the error identifier part of an HResult.
Public methodStatic memberGetFacilityId
Gets the facility (= the assembly) identifier part of an HResult.
Public methodStatic memberHexStringToByteArray
Converts a string of hexadecimal values into a byte array.
Public methodStatic memberIsCustomHResult
Checks if the specified HRESULT is a custom error value.
Top
Fields
  NameDescription
Public fieldStatic memberCode exampleCustomHResultMask
A bit mask to check if the HResult is a custom value.
Public fieldStatic memberCode exampleErrorIdMask
A bit mask to filter the error id of the HResult.
Public fieldStatic memberCode exampleFacilityIdMask
A bit mask to filter the id of the facility (= the assembly) that threw the exception.
Public fieldStatic memberCode exampleFacilityIdShift
The number of bits to shift an HResult to the left to get the facility (= the assembly) id on the lowest bit.
Public fieldStatic memberHResultBase
The base value for all custom HRESULT values, to unambiguously distinguish the exceptions from Microsoft error codes.
Top
Remarks
See the HRESULT definition at MSDN for more information about the definition of HRESULT values.
See Also