[]
        
(Showing Draft Content)

C1.WPF.ExpressionEditor.C1ExpressionEditor

C1ExpressionEditor Class

The C1ExpressionEditor control is used to dynamically produce an expression and get the result of the expression. It supports DataBinding and integrates with controls which provide the ISupportExpressions interface. C1ExpressionEditor can also use field values of such control in expression string.

Namespace: C1.WPF.ExpressionEditor
Assembly: C1.WPF.ExpressionEditor.4.6.2.dll
Syntax
[TemplatePart(Name = "ExpressionTextBox", Type = typeof(C1ExpressionRichTextBox))]
[TemplatePart(Name = "ExpressionErrorText", Type = typeof(TextBlock))]
public class C1ExpressionEditor : Control, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IDisposable

Constructors

Name Description
C1ExpressionEditor()

Initializes a new instance of a C1ExpressionEditor.

Fields

Name Description
DataSourceProperty

Identifies the DataSource dependency property.

ExpressionProperty

Identifies the Expression dependency property.

ItemContextProperty

Identifies the ItemContext dependency property.

ShowErrorBoxProperty

Identifies the ShowErrorBox dependency property.

SyntaxHighlightingProperty

Identifies the SyntaxHighlighting dependency property.

UnderlineErrorsProperty

Identifies the UnderlineErrors dependency property.

Properties

Name Description
DataSource

Gets or sets the object used as the data source.

Expression

Gets or sets expression string.

InsertItem

Gets the ICommand object which performs insert operations.

IsValid

Gets value that indicates whether the expression is valid.

ItemContext

Gets or sets the object used as the context for evaluating an expression.

SelectedObject

Gets selected object of the support integrate.

ShowErrorBox

Gets or sets a value indicating whether to show errors.

SyntaxHighlighting

Gets or sets a value indicating whether to highlight syntax.

UnderlineErrors

Gets or sets a value indicating whether to underline errors.

Methods

Name Description
AddAlias(string, string)

Adds an alias for a field from DataSource.

AddFunction(ExpressionItem, Func<List<object>, object>, int)

Added a custom function to engine of C1ExpressionEditor.

AddFunction(ExpressionItem, Func<List<object>, object>, int, int)

Added a custom function to engine of C1ExpressionEditor.

AddFunction(List<ExpressionItem>, Func<List<object>, object>, int, int)

Added a custom function to engine of C1ExpressionEditor.

Dispose()

Clean up any resources being used.

Dispose(bool)

Performs cleanup operations on managed and unmanaged resources.

Evaluate(int)

Gets result of the expression.

GetErrors()

Gets list of ErrorInfo objects.

OnApplyTemplate()

Builds the visual tree for the C1ExpressionEditor control when a new template is applied.

OnExpressionChanged(EventArgs)

Rises the ExpressionChanged event.

ResetEngine()

Resets a engine of C1ExpressionEditor to default.

SetCustomEngine(IEngine, IExpressionLexer)

Sets a custom engine to C1ExpressionEditor.

TryEvaluate(out object)

Gets a result of expression. A return value indicates whether the evaluate succeeded or failed.

Events

Name Description
ExpressionChanged

Occurs when expression string changed.