Class DefaultTriggerAttribute
Provides design tools information about what TriggerBase to instantiate for a given action or command.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple = true)]
public sealed class DefaultTriggerAttribute : Attribute
- Inheritance
-
DefaultTriggerAttribute
- Inherited Members
- Extension Methods
Constructors
DefaultTriggerAttribute(Type, Type, object)
Initializes a new instance of the DefaultTriggerAttribute class.
public DefaultTriggerAttribute(Type targetType, Type triggerType, object parameter)
Parameters
targetType
TypeThe type this attribute applies to.
triggerType
TypeThe type of TriggerBase to instantiate.
parameter
objectA single argument for the specified TriggerBase.
Remarks
This constructor is useful if the specifed TriggerBase has a single argument. The resulting code will be CLS compliant.
Exceptions
- ArgumentException
is not derived from TriggerBase.
DefaultTriggerAttribute(Type, Type, params object[])
Initializes a new instance of the DefaultTriggerAttribute class.
public DefaultTriggerAttribute(Type targetType, Type triggerType, params object[] parameters)
Parameters
targetType
TypeThe type this attribute applies to.
triggerType
TypeThe type of TriggerBase to instantiate.
parameters
object[]The constructor arguments for the specified TriggerBase.
Exceptions
- ArgumentException
is not derived from TriggerBase.
Properties
Parameters
Gets the parameters to pass to the TriggerBase constructor.
public IEnumerable Parameters { get; }
Property Value
- IEnumerable
The parameters to pass to the TriggerBase constructor.
TargetType
Gets the type that this DefaultTriggerAttribute applies to.
public Type TargetType { get; }
Property Value
- Type
The type this DefaultTriggerAttribute applies to.
TriggerType
Gets the type of the TriggerBase to instantiate.
public Type TriggerType { get; }
Property Value
- Type
The type of the TriggerBase to instantiate.
Methods
Instantiate()
Instantiates this instance.
public TriggerBase Instantiate()
Returns
- TriggerBase
The TriggerBase specified by the DefaultTriggerAttribute.