TypeIdentifierAttribute Constructors

Definition

Creates a new instance of the TypeIdentifierAttribute class.

Overloads

TypeIdentifierAttribute()

Creates a new instance of the TypeIdentifierAttribute class.

TypeIdentifierAttribute(String, String)

Creates a new instance of the TypeIdentifierAttribute class with the specified scope and identifier.

TypeIdentifierAttribute()

Source:
TypeIdentifierAttribute.cs
Source:
TypeIdentifierAttribute.cs
Source:
TypeIdentifierAttribute.cs

Creates a new instance of the TypeIdentifierAttribute class.

C#
public TypeIdentifierAttribute();

Remarks

This constructor overload does not accept parameters. Therefore, interfaces that have this attribute use the type's GUID and simple name to establish type equivalence.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

TypeIdentifierAttribute(String, String)

Source:
TypeIdentifierAttribute.cs
Source:
TypeIdentifierAttribute.cs
Source:
TypeIdentifierAttribute.cs

Creates a new instance of the TypeIdentifierAttribute class with the specified scope and identifier.

C#
public TypeIdentifierAttribute(string scope, string identifier);
C#
public TypeIdentifierAttribute(string? scope, string? identifier);

Parameters

scope
String

The first type equivalence string.

identifier
String

The second type equivalence string.

Remarks

The scope and identifier parameters are used to establish type equivalence. They are combined into a GUID and become the key that is used for type equivalence. This constructor is particularly useful for types that do not have GUIDs in their type library.

The TypeIdentifierAttribute class internally maintains the scope and identifier parameters as private members.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0