Open sandboxFocus

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.