[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.HResultDescriptor

Class HResultDescriptor

Namespace
GrapeCity.Documents.DX
Assembly
GcDocs.DX.Windows.dll

Descriptor used to provide detailed message for a particular Result.

public sealed class HResultDescriptor
Inheritance
object
HResultDescriptor
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Constructors

HResultDescriptor(HResult, string, string, string, string)

Initializes a new instance of the HResultDescriptor class.

public HResultDescriptor(HResult code, string module, string nativeApiCode, string apiCode, string description = null)

Parameters

code HResult

The HRESULT error code.

module string

The module (ex: C1.Win.DX.Direct2D).

nativeApiCode string

The native API code.

apiCode string

The API code (ex: D2D1_ERR_...).

description string

The description of the result code if any.

Properties

ApiCode

Gets the API code (ex: DemiceRemoved ...)

public string ApiCode { get; }

Property Value

string

Description

Gets the description of the result code if any.

public string Description { get; set; }

Property Value

string

Module

Gets the module (ex: C1.Win.DX.Direct2D)

public string Module { get; }

Property Value

string

NativeApiCode

Gets the native API code (ex: D2D1_ERR_ ...)

public string NativeApiCode { get; }

Property Value

string

Result

Gets the result.

public HResult Result { get; }

Property Value

HResult

Methods

Equals(HResultDescriptor)

Determines whether the specified HResultDescriptor is equal to this instance.

public bool Equals(HResultDescriptor other)

Parameters

other HResultDescriptor

The HResultDescriptor to compare with this instance.

Returns

bool

true if the specified HResultDescriptor is equal to this instance; otherwise, false.

Equals(object)

Determines whether the specified object is equal to this instance.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with this instance.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

Find(HResult)

Finds the specified result descriptor.

public static HResultDescriptor Find(HResult result)

Parameters

result HResult

The result code.

Returns

HResultDescriptor

A descriptor for the specified result

GetHashCode()

public override int GetHashCode()

Returns

int

RegisterProvider(Type)

Registers a HResultDescriptor provider.

public static void RegisterProvider(Type descriptorsProviderType)

Parameters

descriptorsProviderType System.Type

Type of the descriptors provider.

Remarks

Providers are usually registered at module init when C1.Win.DX assemblies are loaded.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(HResultDescriptor, HResult)

Implements the operator ==.

public static bool operator ==(HResultDescriptor left, HResult right)

Parameters

left HResultDescriptor

The left.

right HResult

The right.

Returns

bool

The result of the operator.

implicit operator HResult(HResultDescriptor)

Performs an implicit conversion from HResultDescriptor to HResult.

public static implicit operator HResult(HResultDescriptor result)

Parameters

result HResultDescriptor

The result.

Returns

HResult

The result of the conversion.

operator !=(HResultDescriptor, HResult)

Implements the operator !=.

public static bool operator !=(HResultDescriptor left, HResult right)

Parameters

left HResultDescriptor

The left.

right HResult

The right.

Returns

bool

The result of the operator.