Open sandboxFocus

Method SelectDeclarationsWithAttribute

SelectDeclarationsWithAttribute<TAttribute>(IAspectReceiver<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 IAspectReceiver<IDeclaration> SelectDeclarationsWithAttribute<TAttribute>(this IAspectReceiver<ICompilation> receiver, Func<TAttribute, bool>? predicate = null, bool includeDerivedTypes = true)
Parameters
Type Name Description
IAspectReceiver<ICompilation> receiver
Func<TAttribute, bool> predicate
bool includeDerivedTypes
Returns
Type Description
IAspectReceiver<IDeclaration>
Type Parameters
Name Description
TAttribute

SelectDeclarationsWithAttribute(IAspectReceiver<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 IAspectReceiver<IDeclaration> SelectDeclarationsWithAttribute(this IAspectReceiver<ICompilation> receiver, Type attributeType, Func<IAttribute, bool>? predicate = null, bool includeDerivedTypes = true)
Parameters
Type Name Description
IAspectReceiver<ICompilation> receiver
Type attributeType
Func<IAttribute, bool> predicate
bool includeDerivedTypes
Returns
Type Description
IAspectReceiver<IDeclaration>