Прочетете на английски Редактиране

Споделяне чрез


AssemblyBuilder.GetCustomAttributes Method

Definition

Returns custom attributes that have been applied to the current AssemblyBuilder.

Overloads

GetCustomAttributes(Type, Boolean)

Returns all the custom attributes that have been applied to the current AssemblyBuilder, and that derive from a specified attribute type.

GetCustomAttributes(Boolean)

Returns all the custom attributes that have been applied to the current AssemblyBuilder.

GetCustomAttributes(Type, Boolean)

Source:
AssemblyBuilder.cs

Returns all the custom attributes that have been applied to the current AssemblyBuilder, and that derive from a specified attribute type.

C#
public override object[] GetCustomAttributes(Type attributeType, bool inherit);

Parameters

attributeType
Type

The base type from which attributes derive.

inherit
Boolean

This argument is ignored for objects of this type.

Returns

Object[]

An array that contains the custom attributes that are derived at any level from attributeType; the array is empty if there are no such attributes.

Exceptions

attributeType is null.

attributeType is not a Type object supplied by the runtime. For example, attributeType is a TypeBuilder object.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.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 2.0 (package-provided)

GetCustomAttributes(Boolean)

Source:
AssemblyBuilder.cs

Returns all the custom attributes that have been applied to the current AssemblyBuilder.

C#
public override object[] GetCustomAttributes(bool inherit);

Parameters

inherit
Boolean

This argument is ignored for objects of this type.

Returns

Object[]

An array that contains the custom attributes; the array is empty if there are no attributes.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.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 2.0 (package-provided)