Class ExpressionBuilder
Provides the abstract base class for all expression tree node builders.
Inheritance
Implements
Inherited Members
Namespace: Bonsai.Expressions
Assembly: Bonsai.Core.dll
Syntax
[TypeConverter("Bonsai.Design.ExpressionBuilderTypeConverter, Bonsai.Design")]
public abstract class ExpressionBuilder : IExpressionBuilder
Constructors
| Improve this Doc View SourceExpressionBuilder()
Initializes a new instance of the ExpressionBuilder class.
Declaration
protected ExpressionBuilder()
Properties
| Improve this Doc View SourceArgumentRange
Gets the range of input arguments that this expression builder accepts.
Declaration
[Browsable(false)]
public abstract Range<int> ArgumentRange { get; }
Property Value
Type | Description |
---|---|
Range<Int32> |
Methods
| Improve this Doc View SourceBuild(IEnumerable<Expression>)
Constructs an Expression node from a collection of input arguments. The result can be chained with other builders in a workflow.
Declaration
public abstract Expression Build(IEnumerable<Expression> arguments)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Expression> | arguments | A collection of Expression nodes representing the input arguments. |
Returns
Type | Description |
---|---|
Expression | The constructed Expression node. |
FromWorkflowElement(Object, ElementCategory)
Creates a new expression builder from the specified editor browsable element and category.
Declaration
public static ExpressionBuilder FromWorkflowElement(object element, ElementCategory elementCategory)
Parameters
Type | Name | Description |
---|---|---|
Object | element | The editor browsable element for which to build a new expression builder. |
ElementCategory | elementCategory | The workflow category of the specified element. |
Returns
Type | Description |
---|---|
ExpressionBuilder | A new ExpressionBuilder object. |
GetElementDisplayName(Object)
Gets the display name for the specified element.
Declaration
public static string GetElementDisplayName(object element)
Parameters
Type | Name | Description |
---|---|---|
Object | element | The element for which to retrieve the display name. |
Returns
Type | Description |
---|---|
String | The name of the element. |
GetElementDisplayName(Type)
Gets the display name for the specified type.
Declaration
public static string GetElementDisplayName(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The Type for which to retrieve the display name. |
Returns
Type | Description |
---|---|
String | The display name for the specified |
GetVisualizerElement(ExpressionBuilder)
Returns the InspectBuilder instance that should be used to visualize the specified workflow element.
Declaration
public static InspectBuilder GetVisualizerElement(ExpressionBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ExpressionBuilder | builder | The ExpressionBuilder for which to retrieve the visualizer element. |
Returns
Type | Description |
---|---|
InspectBuilder | The InspectBuilder instance that should be used to visualize the specified workflow element. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GetVisualizerMappings(ExpressionBuilder)
Returns the read-only collection of visualizer mappings that have been assigned to the specified workflow element.
Declaration
public static IReadOnlyList<VisualizerMapping> GetVisualizerMappings(ExpressionBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ExpressionBuilder | builder | The ExpressionBuilder for which to retrieve visualizer mappings. |
Returns
Type | Description |
---|---|
IReadOnlyList<VisualizerMapping> | The read-only collection of VisualizerMapping objects that have been assigned to the specified workflow element. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GetWorkflowElement(ExpressionBuilder)
Returns the editor browsable element for the specified ExpressionBuilder.
Declaration
public static object GetWorkflowElement(ExpressionBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ExpressionBuilder | builder | The ExpressionBuilder for which to retrieve the editor browsable element. |
Returns
Type | Description |
---|---|
Object | An Object that is the editor browsable element for the specified
|
ToString()
Returns a string that represents the display name of this ExpressionBuilder instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The string representation of this ExpressionBuilder object. |
Overrides
| Improve this Doc View SourceUnwrap(ExpressionBuilder)
Removes all decorators from a specified ExpressionBuilder instance and returns the first non-decorated (i.e. primitive) builder.
Declaration
public static ExpressionBuilder Unwrap(ExpressionBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ExpressionBuilder | builder | An ExpressionBuilder instance from which to remove decorators. |
Returns
Type | Description |
---|---|
ExpressionBuilder | The non-decorated ExpressionBuilder instance. |