Show / Hide Table of Contents

Class Type<T>.Attribute<A>

Provides typed access to the type attribute.

Inheritance
Object
Type<T>.Attribute<A>
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public static class Attribute<A> : object where A : Type<T>.Attribute
Type Parameters
Name Description
A

Type of attribute.

Methods

| Improve this Doc View Source

Get(Boolean, Predicate<A>)

Returns attribute associated with the type T.

Declaration
public static A Get(bool inherit = false, Predicate<A> condition = null)
Parameters
Type Name Description
Boolean inherit

True to find inherited attribute.

Predicate<A> condition

Optional predicate to check attribute properties.

Returns
Type Description
A

Attribute associated with type T; or null, if attribute doesn't exist.

| Improve this Doc View Source

GetAll(Boolean, Predicate<A>)

Get all custom attributes of type A.

Declaration
public static IEnumerable<A> GetAll(bool inherit = false, Predicate<A> condition = null)
Parameters
Type Name Description
Boolean inherit

True to find inherited attribute.

Predicate<A> condition

Optional predicate to check attribute properties.

Returns
Type Description
IEnumerable<A>

All attributes associated with type T.

| Improve this Doc View Source

Require(Boolean, Predicate<A>)

Returns attribute associated with the type T.

Declaration
public static A Require(bool inherit = false, Predicate<A> condition = null)
Parameters
Type Name Description
Boolean inherit

True to find inherited attribute.

Predicate<A> condition

Optional predicate to check attribute properties.

Returns
Type Description
A

Attribute associated with type T.

Exceptions
Type Condition
MissingAttributeException

Event doesn't exist.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX