Reports a warning when any type in the selection is used from the context matching the specified predicate.
Declaration
public static void CannotBeUsedFrom(this IAspectReceiver<IDeclaration> receiver, Func<ReferencePredicateBuilder, ReferencePredicate> predicate, string? description = null, ReferenceKinds referenceKinds = (ReferenceKinds)-1)
Parameters
Reports a warning when any type in the selection is used from the context matching the specified predicate.
This overload supplies the selected declaration to the predicate.
Declaration
public static void CannotBeUsedFrom<TDeclaration>(this IAspectReceiver<TDeclaration> receiver, Func<ReferencePredicateBuilder, TDeclaration, ReferencePredicate> predicate, string? description = null, ReferenceKinds referenceKinds = (ReferenceKinds)-1) where TDeclaration : class, IDeclaration
Parameters
Type Parameters
Name |
Description |
TDeclaration |
|
Reports a warning when any type in the selection is used from the context matching the specified predicate.
This overload supplies the selected declaration and the tag (added using Tag<TTag>(Func<TDeclaration, TTag>)) to the predicate.
Declaration
public static void CannotBeUsedFrom<TDeclaration, TTag>(this IAspectReceiver<TDeclaration, TTag> receiver, Func<ReferencePredicateBuilder, TDeclaration, TTag, ReferencePredicate> predicate, string? description = null, ReferenceKinds referenceKinds = (ReferenceKinds)-1) where TDeclaration : class, IDeclaration
Parameters
Type Parameters
Name |
Description |
TDeclaration |
|
TTag |
|