Редактиране

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


PropertyBuilder.IsDefined(Type, Boolean) Method

Definition

Indicates whether one or more instance of attributeType is defined on this property.

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 object to which the custom attributes are applied.

inherit
Boolean

Specifies whether to walk up this property's inheritance chain to find the custom attributes.

Returns

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

Exceptions

This method is not supported.

Remarks

Reflect on the property's parent type using Type.GetType or Assembly.GetType, retrieve the Reflection property object from the type, and call PropertyInfo.IsDefined.

Applies to