Editare

Partajați prin


FieldBuilder.IsDefined(Type, Boolean) Method

Definition

Indicates whether an attribute having the specified type is defined on a field.

public:
 override bool IsDefined(Type ^ attributeType, bool inherit);
public override bool IsDefined (Type attributeType, bool inherit);
override this.IsDefined : Type * bool -> bool
Public Overrides Function IsDefined (attributeType As Type, inherit As Boolean) As Boolean

Parameters

attributeType
Type

The type of the attribute.

inherit
Boolean

Controls inheritance of custom attributes from base classes.

Returns

true if one or more instance of attributeType is defined on this field; otherwise, false.

Exceptions

This method is not currently supported. Retrieve the field using GetField(String, BindingFlags) and call IsDefined(Type, Boolean) on the returned FieldInfo.

Applies to