• Docs
  • Learn
  • Community
    Search Results for

      Show / Hide Table of Contents

      Class PropertyMappingBuilder

      Represents an expression builder that assigns values of an observable sequence to properties of a workflow element.

      The connection between the property mapping and its target node only affects the state of properties. The behaviour of the operator will otherwise remain unaffected, since the subscription to the mapping is not considered as a proper upstream source. This is indicated in the editor by the dashed line linking the property mapping operator to its target.

      Warning

      Because property values are updated independently, this means that values can change even while the target operator is reacting to notifications from other nodes. Care must be taken to ensure that changing the property state in this way does not break the behaviour of the workflow.

      Specifically, some operators respond to changes in their parameters only at specific moments. For example, the parameters of the Timer operator must be set before the observable sequence is initialized. In this case, the input to the externalized property needs to be emitted immediately during the subscription phase for the mapping to work.

      Multiple properties can be mapped simultaneously from the same source sequence when using PropertyMapping. You can select which properties to map by using the editors available in the property grid. For each mapped property you must specify a source selector, i.e. an expression specifying which members of the input data type are used to assign values to the mapped property.

      Note

      If the type of the selected member does not match the type of the property, a conversion is attempted. If no compatible conversion is available, the compiler checks whether it is possible to construct the corresponding data type from the selected members. For example, it would be possible to map to a Point type by selecting two numeric values from the source sequence. In this case, the values would be used to construct a new point instance by assigning them to the X and Y parameters of the type constructor.

      In each property mapping operator, all mapped properties are updated at the same time every time the source sequence sends out a new value. It is also possible to connect property mapping operators to multiple target nodes.

      Inheritance
      Object
      ExpressionBuilder
      SingleArgumentExpressionBuilder
      PropertyMappingBuilder
      InputMappingBuilder
      Implements
      IExpressionBuilder
      INamedElement
      Inherited Members
      SingleArgumentExpressionBuilder.ArgumentRange
      ExpressionBuilder.ToString()
      ExpressionBuilder.Unwrap(ExpressionBuilder)
      ExpressionBuilder.GetWorkflowElement(ExpressionBuilder)
      ExpressionBuilder.GetVisualizerElement(ExpressionBuilder)
      ExpressionBuilder.GetVisualizerMappings(ExpressionBuilder)
      ExpressionBuilder.FromWorkflowElement(Object, ElementCategory)
      ExpressionBuilder.GetElementDisplayName(Type)
      ExpressionBuilder.GetElementDisplayName(Object)
      Object.Equals(Object)
      Object.Equals(Object, Object)
      Object.ReferenceEquals(Object, Object)
      Object.GetHashCode()
      Object.GetType()
      Object.MemberwiseClone()
      Namespace: Bonsai.Expressions
      Assembly: Bonsai.Core.dll
      Syntax
      [WorkflowElementCategory(ElementCategory.Property)]
      public class PropertyMappingBuilder : SingleArgumentExpressionBuilder, IExpressionBuilder, INamedElement

      Properties

      | Improve this Doc View Source

      PropertyMappings

      Gets a collection of property mappings that specify how input values are assigned to properties of the workflow element.

      Declaration
      public PropertyMappingCollection PropertyMappings { get; }
      Property Value
      Type Description
      PropertyMappingCollection

      Methods

      | Improve this Doc View Source

      Build(IEnumerable<Expression>)

      Generates an Expression node from a collection of input arguments. The result can be chained with other builders in a workflow.

      Declaration
      public override Expression Build(IEnumerable<Expression> arguments)
      Parameters
      Type Name Description
      IEnumerable<Expression> arguments

      A collection of Expression nodes that represents the input arguments.

      Returns
      Type Description
      Expression

      An Expression tree node.

      Overrides
      ExpressionBuilder.Build(IEnumerable<Expression>)

      Explicit Interface Implementations

      | Improve this Doc View Source

      INamedElement.Name

      Declaration
      string INamedElement.Name { get; }
      Returns
      Type Description
      String

      Implements

      IExpressionBuilder
      INamedElement

      Extension Methods

      ExpressionBuilderGraphExtensions.Build(ExpressionBuilder, Expression[])
      ExpressionBuilderGraphExtensions.IsBuildDependency(ExpressionBuilder)
      ExpressionBuilderGraphExtensions.AsInspectBuilder(ExpressionBuilder)
      • Improve this Doc
      • View Source
      In This Article
      Back to top Generated by DocFX