Open sandboxFocus

Class ArchitectureExtensions

Extension methods that verify the architecture. These methods extend the IAspectReceiver<TDeclaration> interface, which is returned by the Verify(IProjectAmender) method of the AmenderExtensions class.

Inheritance
ArchitectureExtensions
Namespace: Metalama.Extensions.Architecture
Assembly: Metalama.Extensions.Architecture.dll
Syntax
[CompileTime]
public static class ArchitectureExtensions

Methods

Name Description
CanOnlyBeUsedFrom(IAspectReceiver<IDeclaration>, Func<ReferencePredicateBuilder, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any type in the selection is used from a different context than the ones matching the specified predicate.

CanOnlyBeUsedFrom<TDeclaration>(IAspectReceiver<TDeclaration>, Func<ReferencePredicateBuilder, TDeclaration, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any type in the selection is used from a different context than the ones matching the specified predicate. This overload supplies the selected declaration to the predicate.

CanOnlyBeUsedFrom<TDeclaration, TTag>(IAspectReceiver<TDeclaration, TTag>, Func<ReferencePredicateBuilder, TDeclaration, TTag, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any type in the selection is used from a different context than the ones matching the specified predicate. This overload supplies the selected declaration and the tag (added using Tag<TTag>(Func<TDeclaration, TTag>)) to the predicate.

CannotBeUsedFrom(IAspectReceiver<IDeclaration>, Func<ReferencePredicateBuilder, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any type in the selection is used from the context matching the specified predicate.

CannotBeUsedFrom<TDeclaration>(IAspectReceiver<TDeclaration>, Func<ReferencePredicateBuilder, TDeclaration, ReferencePredicate>, string?, ReferenceKinds)

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.

CannotBeUsedFrom<TDeclaration, TTag>(IAspectReceiver<TDeclaration, TTag>, Func<ReferencePredicateBuilder, TDeclaration, TTag, ReferencePredicate>, string?, ReferenceKinds)

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.

DerivedTypesMustRespectNamingConvention(IAspectReceiver<IDeclaration>, string, Func<ReferencePredicateBuilder, ReferencePredicate>?)

Reports a warning when any type that inherits any type in the current selection does not follow a given convention, where the convention is given as a star pattern, i.e. where the * matches any sequence of characters, even empty.

DerivedTypesMustRespectRegexNamingConvention(IAspectReceiver<IDeclaration>, string, Func<ReferencePredicateBuilder, ReferencePredicate>?)

Reports a warning when any type that inherits any type in the current selection does not follow a given convention, where the convention is given as a regular expression.

Experimental(IAspectReceiver<IDeclaration>)

Reports a warning when the target declaration is used by a declaration that it not itself marked as experimental.

InternalsCanOnlyBeUsedFrom(IAspectReceiver<IDeclaration>, Func<ReferencePredicateBuilder, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any of the internal APIs of the current selection in used from a different context than the one allowed, except if this concept has access to the type using inheritance rules.

InternalsCanOnlyBeUsedFrom<TDeclaration>(IAspectReceiver<TDeclaration>, Func<ReferencePredicateBuilder, TDeclaration, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any of the internal APIs of the current selection in used from a different context than the one allowed, except if this concept has access to the type using inheritance rules. This overload supplies the selected declaration to the predicate.

InternalsCanOnlyBeUsedFrom<TDeclaration, TTag>(IAspectReceiver<TDeclaration, TTag>, Func<ReferencePredicateBuilder, TDeclaration, TTag, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any of the internal APIs of the current selection in used from a different context than the one allowed, except if this concept has access to the type using inheritance rules. This overload supplies the selected declaration and the tag (added using Tag<TTag>(Func<TDeclaration, TTag>)) to the predicate.

InternalsCannotBeUsedFrom(IAspectReceiver<IDeclaration>, Func<ReferencePredicateBuilder, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any of the internal APIs of the current selection in used from a different context different than the one allowed, except if this concept has access to the type using inheritance rules.

InternalsCannotBeUsedFrom<TDeclaration>(IAspectReceiver<TDeclaration>, Func<ReferencePredicateBuilder, TDeclaration, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any of the internal APIs of the current selection in used from a different context different than the one allowed, except if this concept has access to the type using inheritance rules. This overload supplies the selected declaration to the predicate.

InternalsCannotBeUsedFrom<TDeclaration, TTag>(IAspectReceiver<TDeclaration, TTag>, Func<ReferencePredicateBuilder, TDeclaration, TTag, ReferencePredicate>, string?, ReferenceKinds)

Reports a warning when any of the internal APIs of the current selection in used from a different context different than the one allowed, except if this concept has access to the type using inheritance rules. This overload supplies the selected declaration and the tag (added using Tag<TTag>(Func<TDeclaration, TTag>)) to the predicate.

MustRespectNamingConvention(IAspectReceiver<INamedDeclaration>, string)

Reports a warning when any declaration in the selection fails to respect the given naming convention, with the asterisk character (*) matching any substring.

MustRespectRegexNamingConvention(IAspectReceiver<INamedDeclaration>, string)

Reports a warning when any declaration in the selection fails not respect the given naming convention, given as a regular expression.