Properties | List of all members
TriggerCondition Interface Reference

Configure trigger conditions. More...

Inheritance diagram for TriggerCondition:

Properties

TriggerConditionOperation ConditionOperation [get, set]
 Gets or sets the comparison operator that you use to compare Value A to Value B: More...
 
object FixedPropertyValue [get, set]
 
bool IsValid [get]
 Gets the validity of the trigger condition. More...
 
EventProperty MessageA [get, set]
 
EventProperty MessageB [get, set]
 
ProjectItem ProjectItemA [get, set]
 
ProjectItem ProjectItemB [get, set]
 
Property PropertyA [get, set]
 
AnimationTargetPropertyAttributeEnum PropertyAttributeA [get, set]
 
AnimationTargetPropertyAttributeEnum PropertyAttributeB [get, set]
 
Property PropertyB [get, set]
 
TriggerConditionTermSourceType TermASource [get, set]
 
TriggerConditionTermSourceType TermBSource [get, set]
 Gets or sets whether the trigger condition compares to a value (Value B) that comes from a property, a message, or a fixed value: More...
 

Detailed Description

Configure trigger conditions.

Trigger conditions enable you to set which conditions must be met for the trigger to set off. For example, you can define conditions to set off a trigger when the user selects a specific item in a list box or presses a specific key on their keyboard, or to enable the user to click a button only when that button is visible, or to allow the user to scroll a Scroll View node only when a specific Page node is active.

To configure a trigger condition, define Value A and Value B, and a comparison operator that you use to compare Value A to Value B:

See also
Trigger, MessageTrigger, NodeComponentHost

Examples

To create and configure a trigger condition using a value from a property:

// Create and configure a trigger condition which makes a trigger set off only
// when the Visible property of the Button 2D node is enabled:
public void Execute(PluginCommandParameter parameter)
{
// Get the Screens/Screen/RootPage node.
var rootPage = studio.Project.GetProjectItem("Screens/Screen/RootPage");
// Create a Button 2D node in the RootPage node.
var button =
studio.Project.CreateProjectItem<Button2D>(rootPage.GenerateUniqueChildName("Button 2D"), rootPage);
// Add the Visible property for the Button 2D node and set it to true.
button.Set(Properties.NodeVisible, true);
// Get the first Button: Click trigger in the Button 2D node.
var clickTrigger =
button.Triggers.First(trigger => trigger.TriggerProperty == Properties.MessageButtonClick);
// Create a trigger condition for the first Button: Click trigger in the Button 2D node.
var triggerCondition = clickTrigger.CreateCondition();
// Set the trigger condition to compare a value that comes from a property.
triggerCondition.TermASource = TriggerConditionTermSourceType.FROM_PROPERTY;
// Set the node the property of which you want to compare to Button 2D.
triggerCondition.ProjectItemA = button;
// Set the property which you want to compare to Visible.
triggerCondition.PropertyA = Properties.NodeVisible;
// Set the property attribute which you want to compare.
// Because you want to compare the NodeVisible property and not its attribute, use WHOLE_PROPERTY.
triggerCondition.PropertyAttributeA = AnimationTargetPropertyAttributeEnum.WHOLE_PROPERTY;
// Set the comparison operator to =.
triggerCondition.ConditionOperation = TriggerConditionOperation.EQUALS;
// Set the trigger condition to compare to a fixed value.
triggerCondition.TermBSource = TriggerConditionTermSourceType.FIXED;
// Set the fixed value to true.
triggerCondition.FixedPropertyValue = true;
}

To create and configure a trigger condition using a value from a list box message:

// Create and configure a trigger condition which makes a trigger set off only
// when the user selects any item but the first one in a Grid List Box 2D node:
public void Execute(PluginCommandParameter parameter)
{
// Get the Screens/Screen/RootPage node.
var rootPage = studio.Project.GetProjectItem("Screens/Screen/RootPage");
// Create a Grid List Box 2D node in the RootPage node.
var listBox =
studio.Project.CreateProjectItem<GridListBox2D>(rootPage.GenerateUniqueChildName("Grid List Box 2D"), rootPage);
// Create a List Box: Item Selected trigger in the Grid List Box 2D node.
var itemSelectedTrigger = listBox.CreateTrigger(Properties.MessageListBoxItemSelected);
// Create a trigger condition for the List Box: Item Selected trigger in the Grid List Box 2D node.
var triggerCondition = itemSelectedTrigger.CreateCondition();
// Set the trigger condition to compare a value that comes from a message.
triggerCondition.TermASource = TriggerConditionTermSourceType.FROM_MESSAGE;
// Set the message argument which you want to compare to the index of the selected item of the Grid List Box 2D node.
triggerCondition.MessageA = Properties.ListBoxConceptItemSelectedMessageArgumentsSelectedItemIndex;
// Set the comparison operator to !=.
triggerCondition.ConditionOperation = TriggerConditionOperation.DIFFERENT;
// Set the trigger condition to compare to a fixed value.
triggerCondition.TermBSource = TriggerConditionTermSourceType.FIXED;
// Set the fixed value to 0 to make the trigger set off when the user selects any item but the first one in the Grid List Box 2D node.
triggerCondition.FixedPropertyValue = 0;
}

To create and configure a trigger condition using a value from a keyboard message:

// Create and configure a trigger condition which makes a trigger set off when the user presses the Enter key:
public void Execute(PluginCommandParameter parameter)
{
// Create a Key Down trigger in the Screen node.
var keyDownTrigger = studio.Project.Screen.CreateTrigger(Properties.MessageKeyDown);
// Create a trigger condition for the Key Down trigger in the Screen node.
var triggerCondition = keyDownTrigger.CreateCondition();
// Set the trigger condition to compare a value that comes from a message.
triggerCondition.TermASource = TriggerConditionTermSourceType.FROM_MESSAGE;
// Set the message argument which you want to compare to the target key.
triggerCondition.MessageA = Properties.MessageArgumentKey;
// Set the comparison operator to =.
triggerCondition.ConditionOperation = TriggerConditionOperation.EQUALS;
// Set the trigger condition to compare to a fixed value.
triggerCondition.TermBSource = TriggerConditionTermSourceType.FIXED;
// Set the fixed value to 0 to make the trigger set off when the user presses the Enter key.
triggerCondition.FixedPropertyValue = 43;
}

Property Documentation

TriggerConditionOperation ConditionOperation
getset

Gets or sets the comparison operator that you use to compare Value A to Value B:

  • NONE for none
  • EQUALS for =
  • DIFFERENT for !=
  • SMALLER for <
  • BIGGER for >
  • SMALLER_OR_EQUALS for <=
  • BIGGER_OR_EQUALS for >=
object FixedPropertyValue
getset

Gets or sets the fixed value to which you want to compare.

To use this property, set TermBSource to FIXED.

See also
TermBSource
bool IsValid
get

Gets the validity of the trigger condition.

Returns
True if the trigger condition is valid, otherwise false.
EventProperty MessageA
getset

Gets or sets the message argument which you want to compare.

To use this property, set TermASource to FROM_MESSAGE.

See also
TermASource
EventProperty MessageB
getset

Gets or sets the message argument to which you want to compare.

To use this property, set TermBSource to FROM_MESSAGE.

See also
TermBSource
ProjectItem ProjectItemA
getset

Gets or sets the project item a property of which you want to compare.

To use this property, set:

  • TermASource to FROM_PROPERTY.
  • PropertyA to the property which you want to compare
  • PropertyAttributeA to the property attribute which you want to compare
See also
TermASource, PropertyA, PropertyAttributeA
ProjectItem ProjectItemB
getset

Gets or sets the node to a property of which you want to compare.

To use this property, set:

  • TermBSource to FROM_PROPERTY.
  • PropertyB to the property which you want to compare
  • PropertyAttributeB to the property attribute which you want to compare
See also
TermBSource, PropertyB, PropertyAttributeB
Property PropertyA
getset

Gets or sets the property which you want to compare.

To use this property, set:

  • TermASource to FROM_PROPERTY
  • ProjectItemA to the project item the property of which you want to compare
  • PropertyAttributeA to the property attribute which you want to compare
See also
TermASource, ProjectItemA, PropertyAttributeA
AnimationTargetPropertyAttributeEnum PropertyAttributeA
getset

Gets or sets the property attribute which you want to compare.

To compare the whole property instead of an attribute, use WHOLE_PROPERTY.

To use this property, set:

  • TermASource to FROM_PROPERTY
  • ProjectItemA to the project item the property of which you want to compare
  • PropertyA to the property which you want to compare
See also
TermASource, ProjectItemA, PropertyA
AnimationTargetPropertyAttributeEnum PropertyAttributeB
getset

Gets or sets the property attribute to which you want to compare.

To compare to the whole property instead of an attribute, use WHOLE_PROPERTY.

To use this property, set:

  • TermBSource to FROM_PROPERTY
  • ProjectItemB to the project item to the property of which you want to compare
  • PropertyB to the property to which you want to compare
See also
TermBSource, ProjectItemB, PropertyB
Property PropertyB
getset

Gets or sets the property to which you want to compare.

To use this property, set:

  • TermBSource to FROM_PROPERTY
  • ProjectItemB to the project item to the property of which you want to compare
  • PropertyAttributeB to the property attribute to which you want to compare
See also
TermBSource, ProjectItemB, PropertyAttributeB
TriggerConditionTermSourceType TermASource
getset

Gets or sets whether the trigger condition compares a value (Value A) that comes from a property or a message:

  • FROM_PROPERTY for property
  • FROM_MESSAGE for message
TriggerConditionTermSourceType TermBSource
getset

Gets or sets whether the trigger condition compares to a value (Value B) that comes from a property, a message, or a fixed value:

  • FIXED for fixed value
  • FROM_PROPERTY for property
  • FROM_MESSAGE for message