Class ComposeAfterAttribute
Indicates that a composer requires another composer.
Inheritance
Namespace: Umbraco.Core.Composing
Assembly: Umbraco.Core.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
public sealed class ComposeAfterAttribute : Attribute, _Attribute
Remarks
This attribute is not inherited. This means that a composer class inheriting from another composer class does not inherit its requirements. However, the runtime checks the interfaces of every composer for their requirements, so requirements declared on interfaces are inherited by every composer class implementing the interface.
When targeting a class, indicates a dependency on the composer which must be enabled, unless the requirement has explicitly been declared as weak (and then, only if the composer is enabled).
When targeting an interface, indicates a dependency on enabled composers implementing the interface. It could be no composer at all, unless the requirement has explicitly been declared as strong (and at least one composer must be enabled).
Constructors
View SourceComposeAfterAttribute(Type)
Initializes a new instance of the ComposeAfterAttribute class.
Declaration
public ComposeAfterAttribute(Type requiredType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | requiredType | The type of the required composer. |
ComposeAfterAttribute(Type, Boolean)
Initializes a new instance of the ComposeAfterAttribute class.
Declaration
public ComposeAfterAttribute(Type requiredType, bool weak)
Parameters
Type | Name | Description |
---|---|---|
System.Type | requiredType | The type of the required composer. |
System.Boolean | weak | A value indicating whether the requirement is weak. |
Properties
View SourceRequiredType
Gets the required type.
Declaration
public Type RequiredType { get; }
Property Value
Type | Description |
---|---|
System.Type |
Weak
Gets a value indicating whether the requirement is weak.
Declaration
public bool? Weak { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
Remarks
Returns true
if the requirement is weak (requires the other composer if it
is enabled), false
if the requirement is strong (requires the other composer to be
enabled), and null
if unspecified, in which case it is strong for classes and weak for
interfaces.