ComponentResource Class

A resource: a value of a resource type, referenced by handles. The representation of a resource implemented by the host is a .NET object; the representation of a resource implemented by a component is an integer of the component.

public sealed class ComponentResource

Constructors

NameDescription
ComponentResource(ComponentResourceType, object?)Creates a resource implemented by the host.

ComponentResource(ComponentResourceType, object?)

ComponentValue.cs

Creates a resource implemented by the host.

public ComponentResource(ComponentResourceType type, object? representation)

Parameters

type ComponentResourceType
The resource type, created by the host.
representation object?
The representation of the resource.

Exceptions

ArgumentException
The resource type is not a host resource type.

Properties

NameDescription
RepresentationGets the representation of a resource implemented by the host, or null.
TypeGets the resource type.

Representation

ComponentValue.cs

Gets the representation of a resource implemented by the host, or null.

public object? Representation { get; }

Property value

object?

Gets the resource type.

public ComponentResourceType Type { get; }

Property value

ComponentResourceType

Methods

NameDescription
ToString()Returns a string that represents the current object.

Returns a string that represents the current object.

public override string ToString()

Returns

string A string that represents the current object.