Class DependableTrait
Trait for IDependable.
Inheritance
Namespace: Amazon.CDK
Assembly: Amazon.CDK.dll
Syntax (csharp)
public abstract class DependableTrait : DeputyBase
Syntax (vb)
Public MustInherit Class DependableTrait
Inherits DeputyBase
Remarks
Traits are interfaces that are privately implemented by objects. Instead of showing up in the public interface of a class, they need to be queried explicitly. This is used to implement certain framework features that are not intended to be used by Construct consumers, and so should be hidden from accidental use.
Examples
// Usage
var roots = DependableTrait.Get(construct).DependencyRoots;
// Definition
class TraitImplementation : DependableTrait
{
public IConstruct[] DependencyRoots { get; }
public TraitImplementation()
{
DependencyRoots = new [] { constructA, constructB, constructC };
}
}
DependableTrait.Implement(construct, new TraitImplementation());
Synopsis
Constructors
DependableTrait() | |
DependableTrait(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
DependableTrait(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
DependencyRoots | The set of constructs that form the root of this dependable. |
Methods
Get(IDependable) | Return the matching DependableTrait for the given class instance. |
Implement(IDependable, DependableTrait) | Register |
Constructors
DependableTrait()
protected DependableTrait()
DependableTrait(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected DependableTrait(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
DependableTrait(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected DependableTrait(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
DependencyRoots
The set of constructs that form the root of this dependable.
public abstract IConstruct[] DependencyRoots { get; }
Property Value
Remarks
All resources under all returned constructs are included in the ordering dependency.
Methods
Get(IDependable)
Return the matching DependableTrait for the given class instance.
public static DependableTrait Get(IDependable instance)
Parameters
- instance IDependable
Returns
Implement(IDependable, DependableTrait)
Register instance
to have the given DependableTrait.
public static void Implement(IDependable instance, DependableTrait trait)
Parameters
- instance IDependable
- trait DependableTrait
Remarks
Should be called in the class constructor.