Show / Hide Table of Contents

Class CustomAttribute

Contains static methods for retrieving custom attributes.

Inheritance
object
CustomAttribute
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DotNext.Reflection
Assembly: DotNext.dll
Syntax
public static class CustomAttribute

Methods

| Edit this page View Source

IsDefined<TAttribute>(ICustomAttributeProvider, bool)

Indicates whether one or more attributes of the specified type or of its derived types is applied to the member.

Declaration
public static bool IsDefined<TAttribute>(this ICustomAttributeProvider member, bool inherit = false) where TAttribute : Attribute
Parameters
Type Name Description
ICustomAttributeProvider member

The member to inspect.

bool inherit

true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events.

Returns
Type Description
bool

true if one or more instances of TAttribute or any of its derived types is applied to the provided member; otherwise, false.

Type Parameters
Name Description
TAttribute

The type of custom attribute to search for. The search includes derived types.

  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾