Table of Contents

Class ExpressionBuilder

Namespace
Bonsai.Expressions
Assembly
Bonsai.Core.dll

Provides the abstract base class for all expression tree node builders.

[TypeConverter("Bonsai.Design.ExpressionBuilderTypeConverter, Bonsai.Design")]
public abstract class ExpressionBuilder : IExpressionBuilder
Inheritance
ExpressionBuilder
Implements
Derived
Inherited Members
Extension Methods

Constructors

ExpressionBuilder()

Initializes a new instance of the ExpressionBuilder class.

protected ExpressionBuilder()

Properties

ArgumentRange

Gets the range of input arguments that this expression builder accepts.

[Browsable(false)]
public abstract Range<int> ArgumentRange { get; }

Property Value

Range<int>

Methods

Build(IEnumerable<Expression>)

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

public abstract Expression Build(IEnumerable<Expression> arguments)

Parameters

arguments IEnumerable<Expression>

A collection of Expression nodes representing the input arguments.

Returns

Expression

The constructed Expression node.

FromWorkflowElement(object, ElementCategory)

Creates a new expression builder from the specified editor browsable element and category.

public static ExpressionBuilder FromWorkflowElement(object element, ElementCategory elementCategory)

Parameters

element object

The editor browsable element for which to build a new expression builder.

elementCategory ElementCategory

The workflow category of the specified element.

Returns

ExpressionBuilder

A new ExpressionBuilder object.

GetElementDisplayName(object)

Gets the display name for the specified element.

public static string GetElementDisplayName(object element)

Parameters

element object

The element for which to retrieve the display name.

Returns

string

The name of the element.

GetElementDisplayName(Type)

Gets the display name for the specified type.

public static string GetElementDisplayName(Type type)

Parameters

type Type

The Type for which to retrieve the display name.

Returns

string

The display name for the specified type.

GetVisualizerElement(ExpressionBuilder)

Returns the InspectBuilder instance that should be used to visualize the specified workflow element.

public static InspectBuilder GetVisualizerElement(ExpressionBuilder builder)

Parameters

builder ExpressionBuilder

The ExpressionBuilder for which to retrieve the visualizer element.

Returns

InspectBuilder

The InspectBuilder instance that should be used to visualize the specified workflow element.

Exceptions

ArgumentNullException

builder is null.

GetVisualizerMappings(ExpressionBuilder)

Returns the read-only collection of visualizer mappings that have been assigned to the specified workflow element.

public static IReadOnlyList<VisualizerMapping> GetVisualizerMappings(ExpressionBuilder builder)

Parameters

builder ExpressionBuilder

The ExpressionBuilder for which to retrieve visualizer mappings.

Returns

IReadOnlyList<VisualizerMapping>

The read-only collection of VisualizerMapping objects that have been assigned to the specified workflow element.

Exceptions

ArgumentNullException

builder is null.

GetWorkflowElement(ExpressionBuilder)

Returns the editor browsable element for the specified ExpressionBuilder.

public static object GetWorkflowElement(ExpressionBuilder builder)

Parameters

builder ExpressionBuilder

The ExpressionBuilder for which to retrieve the editor browsable element.

Returns

object

An object that is the editor browsable element for the specified builder.

ToString()

Returns a string that represents the display name of this ExpressionBuilder instance.

public override string ToString()

Returns

string

The string representation of this ExpressionBuilder object.

Unwrap(ExpressionBuilder)

Removes all decorators from a specified ExpressionBuilder instance and returns the first non-decorated (i.e. primitive) builder.

public static ExpressionBuilder Unwrap(ExpressionBuilder builder)

Parameters

builder ExpressionBuilder

An ExpressionBuilder instance from which to remove decorators.

Returns

ExpressionBuilder

The non-decorated ExpressionBuilder instance.