Open sandboxFocus
  • TOC

Metalama Documentation

Getting started

Conceptual documentation

Commented examples

API documentation

Aspect API

Metalama.​Framework.​Advising

Metalama.​Framework.​Aspects

Metalama.​Framework.​Code

Metalama.​Framework.​Code.​Collections

Metalama.​Framework.​Code.​Comparers

Metalama.​Framework.​Code.​Declaration­Builders

Metalama.​Framework.​Code.​Invokers

Metalama.​Framework.​Code.​Syntax­Builders

Metalama.​Framework.​Code.​Types

Metalama.​Framework.​Diagnostics

Metalama.​Framework.​Eligibility

Metalama.​Framework.​Fabrics

Metalama.​Framework.​Metrics

Metalama.​Framework.​Options

Metalama.​Framework.​Project

Metalama.​Framework.​Run­Time

Metalama.​Framework.​Serialization

Metalama.​Framework.​Services

Metalama.​Framework.​Utilities

Extensions API

Patterns API

Flashtrace API

Introspection API

Advanced API

Post­Sharp API migration

  • Article

Method IsAspectEligible

IsAspectEligible<T>(IDeclaration, EligibleScenarios)

Determines whether the given declaration is an eligible target for a specified aspect type given as a type parameter.

Declaration
public static bool IsAspectEligible<T>(this IDeclaration declaration, EligibleScenarios scenarios = EligibleScenarios.Aspect) where T : IAspect
Parameters
Type Name Description
IDeclaration declaration

The declaration for which eligibility is determined.

EligibleScenarios scenarios

The scenarios for which eligibility is determined. The default value is Default.

Returns
Type Description
bool

true if declaration is eligible for the aspect type T for any of the specified scenarios.

Type Parameters
Name Description
T

The aspect type.

IsAspectEligible(IDeclaration, Type, EligibleScenarios)

Determines whether the given declaration is an eligible target for a specified aspect type given as a reflection Type(IEligibilityBuilder<IHasType>).

Declaration
public static bool IsAspectEligible(this IDeclaration declaration, Type aspectType, EligibleScenarios scenarios = EligibleScenarios.Aspect)
Parameters
Type Name Description
IDeclaration declaration

The declaration for which eligibility is determined.

Type aspectType

The aspect type.

EligibleScenarios scenarios

The scenarios for which eligibility is determined. The default value is Default.

Returns
Type Description
bool

true if declaration is eligible for the given aspectType for any of the specified scenarios.