Open sandboxFocus

Method SelectDeclarationsWithAttribute

SelectDeclarationsWithAttribute<TAttribute>(IValidatorReceiver<ICompilation>, Func<TAttribute, bool>?, bool)

Selects all custom attributes of a given type in the current compilation. This generic overloads constructs the attribute and accepts an optional predicate to filter the attribute.

Declaration
public static IValidatorReceiver<IDeclaration> SelectDeclarationsWithAttribute<TAttribute>(this IValidatorReceiver<ICompilation> receiver, Func<TAttribute, bool>? predicate = null, bool includeDerivedTypes = true)
Parameters
Type Name Description
IValidatorReceiver<ICompilation> receiver
Func<TAttribute, bool> predicate
bool includeDerivedTypes
Returns
Type Description
IValidatorReceiver<IDeclaration>
Type Parameters
Name Description
TAttribute

SelectDeclarationsWithAttribute(IValidatorReceiver<ICompilation>, Type, Func<IAttribute, bool>?, bool)

Selects all custom attributes of a given type in the current compilation. This overloads accepts an optional predicate to filter the attribute.

Declaration
public static IValidatorReceiver<IDeclaration> SelectDeclarationsWithAttribute(this IValidatorReceiver<ICompilation> receiver, Type attributeType, Func<IAttribute, bool>? predicate = null, bool includeDerivedTypes = true)
Parameters
Type Name Description
IValidatorReceiver<ICompilation> receiver
Type attributeType
Func<IAttribute, bool> predicate
bool includeDerivedTypes
Returns
Type Description
IValidatorReceiver<IDeclaration>