ComponentResourceType Class

A resource type: an abstract type whose values are handles (ComponentOwnType, ComponentBorrowType). Resource types are compared by identity: each resource type definition of a component instance, and each resource type created by the host, is a distinct type.

public sealed class ComponentResourceType : ComponentType
Inheritance
ComponentType ComponentResourceType

Constructors

NameDescription
ComponentResourceType(string?, Action<ComponentResource>?)Creates a resource type implemented by the host: the representation of its resources is a .NET object.

ComponentResourceType(string?, Action<ComponentResource>?)

ComponentTypes.cs

Creates a resource type implemented by the host: the representation of its resources is a .NET object.

public ComponentResourceType(string? name = null, Action<ComponentResource>? destructor = null)

Parameters

name string?
The name of the type, for the diagnostics.
destructor Action<ComponentResource>?
The action called when the last owned handle of a resource is dropped, or null.

Properties

NameDescription
IsHostResourceGets whether the resources of the type are implemented by the host.
NameGets the name of the type, for the diagnostics.

IsHostResource

ComponentTypes.cs

Gets whether the resources of the type are implemented by the host.

public bool IsHostResource { get; }

Property value

bool

Gets the name of the type, for the diagnostics.

public string? Name { get; }

Property value

string?

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.