This namespace allows you to add fabrics to your code. Like aspects, fabrics are executed at compile time. Unlike aspects, you do not need a custom attribute to add the fabric to your code. The only existence of the fabric in your code applies it to your code.
There are four kinds of fabrics. Each kind applies to a different scope. All fabric kinds can add aspects and validators within their scope. Type fabrics can additionally add advice to their scope, and project fabrics can set configuration options.
|Type Fabrics||TypeFabric||The containing type (type fabrics are nested types) and any member.||Add aspects, advice, and validators.|
|Namespace Fabrics||NamespaceFabric||Any type in the namespace that contains the fabric type.||Add aspects and validators.|
|Project Fabrics||ProjectFabric||Any type in the project that contains the fabric type or in any project.||Add aspects and validators, and set configuration options. Project fabrics can be inherited from parent directories.|
|Transitive Project Fabrics||TransitiveProjectFabric||Any type in any project referencing the containing project.||Add aspects and validators, and set configuration options.|
For design-time performance and usability, it is highly recommended to implement type fabrics in a separate file, and mark the parent class as
Allows adding aspects or analyzing a project, namespace, or type just by adding a type inheriting this class. You cannot inherit this class directly, inherit from ProjectFabric, NamespaceFabric, or TypeFabric instead.
A class that, when inherited by a type in a given namespace, allows that type to analyze and add aspects to that namespace.
A class that, when inherited by a type in a project (under any name or namespace), allows that type to analyze and add aspects to that project.
A class that, when inherited by a type in an assembly (under any name or namespace), allows that type to analyze and add aspects to any project that references this assembly. However, the AmendProject(IProjectAmender) method is not executed in the current project (you will need another class that does not implement TransitiveProjectFabric to amend the current project).
An class that, when inherited by a nested type in a given type, allows that nested type to analyze and add aspects to the parent type.
Base interface for the argument of AmendProject(IProjectAmender), AmendNamespace(INamespaceAmender) or AmendType(ITypeAmender). Allows to report diagnostics and add aspects to the target declaration of the fabric.
Represents an instance of a Fabric type including its TargetDeclaration.
Argument of AmendNamespace(INamespaceAmender). Allows reporting diagnostics and adding aspects to the target declaration of the fabric.
Argument of AmendProject(IProjectAmender). Allows reporting diagnostics and adding aspects to the target project.
Argument of AmendType(ITypeAmender). Allows reporting diagnostics and adding aspects to the target declaration of the fabric.