Table of Contents

Class CodeScriptTypeConverter

Namespace
Acuit.Pinpoint.Workflows.Expressions
Assembly
Acuit.Pinpoint.Workflows.dll

A type converter for converting strings to CodeScriptTypeConverter instances.

public class CodeScriptTypeConverter : TypeConverter
Inheritance
CodeScriptTypeConverter
Inherited Members

Remarks

This type converter only supports converting from string, for use by the XAML parser, where the string is used as the code script.

If the context provided to the type converter via CanConvertFrom(ITypeDescriptorContext?, Type) is a WorkflowXamlSchemaContext that has an IExpressionEnvironment available via its ExpressionEnvironment property, then the script will be compiled as part of the conversion. Otherwise, it will be created without compilation and will compile on first reference when the workflow executes.

Constructors

CodeScriptTypeConverter()

public CodeScriptTypeConverter()

Methods

CanConvertFrom(ITypeDescriptorContext?, Type)

Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.

public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)

Parameters

context ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

sourceType Type

A Type that represents the type you want to convert from.

Returns

bool

true if this converter can perform the conversion; otherwise, false.

ConvertFrom(ITypeDescriptorContext?, CultureInfo?, object)

Converts the given object to the type of this converter, using the specified context and culture information.

public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)

Parameters

context ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

culture CultureInfo

The CultureInfo to use as the current culture.

value object

The object to convert.

Returns

object

An object that represents the converted value.

Exceptions

NotSupportedException

The conversion cannot be performed.

Exception

value is not a valid expression text value. (The specific exception thrown varies depending on the expression value type.)

CreateCodeScript(string, ITypeDescriptorContext?)

public static CodeScript CreateCodeScript(string code, ITypeDescriptorContext? context)

Parameters

code string
context ITypeDescriptorContext

Returns

CodeScript