[]
Descriptor used to provide detailed message for a particular Result.
public sealed class HResultDescriptor
Initializes a new instance of the HResultDescriptor class.
public HResultDescriptor(HResult code, string module, string nativeApiCode, string apiCode, string description = null)
code
HResultThe HRESULT error code.
module
stringThe module (ex: C1.Win.DX.Direct2D).
nativeApiCode
stringThe native API code.
apiCode
stringThe API code (ex: D2D1_ERR_...).
description
stringThe description of the result code if any.
Gets the API code (ex: DemiceRemoved ...)
public string ApiCode { get; }
Gets the description of the result code if any.
public string Description { get; set; }
Gets the module (ex: C1.Win.DX.Direct2D)
public string Module { get; }
Gets the native API code (ex: D2D1_ERR_ ...)
public string NativeApiCode { get; }
Gets the result.
public HResult Result { get; }
Determines whether the specified HResultDescriptor is equal to this instance.
public bool Equals(HResultDescriptor other)
other
HResultDescriptorThe HResultDescriptor to compare with this instance.
true
if the specified HResultDescriptor is equal to this instance; otherwise, false
.
Determines whether the specified object is equal to this instance.
public override bool Equals(object obj)
obj
objectThe object to compare with this instance.
true
if the specified object is equal to this instance; otherwise, false
.
Finds the specified result descriptor.
public static HResultDescriptor Find(HResult result)
result
HResultThe result code.
A descriptor for the specified result
public override int GetHashCode()
Registers a HResultDescriptor provider.
public static void RegisterProvider(Type descriptorsProviderType)
descriptorsProviderType
System.TypeType of the descriptors provider.
Providers are usually registered at module init when C1.Win.DX assemblies are loaded.
public override string ToString()
Implements the operator ==.
public static bool operator ==(HResultDescriptor left, HResult right)
left
HResultDescriptorThe left.
right
HResultThe right.
The result of the operator.
Performs an implicit conversion from HResultDescriptor to HResult.
public static implicit operator HResult(HResultDescriptor result)
result
HResultDescriptorThe result.
The result of the conversion.
Implements the operator !=.
public static bool operator !=(HResultDescriptor left, HResult right)
left
HResultDescriptorThe left.
right
HResultThe right.
The result of the operator.