New to Telerik UI for WPFStart a free 30-day trial

An expression parser that parses a string into an lambda expression.

Definition

Namespace:Telerik.Expressions

Assembly:Telerik.Windows.Data.dll

Syntax:

C#
public class RadExpressionParser : IDisposable

Inheritance: objectRadExpressionParser

Implements: IDisposable

Constructors

Initializes a new instance of the RadExpressionParser class.

C#
public RadExpressionParser()

Properties

The parameter to be used if the expression contains such e.g. "() => parameter.ExampleProperty + 11".

C#
public object Item { get; set; }

Methods

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

C#
public void Dispose()

Implements: IDisposable.Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

C#
protected virtual void Dispose(bool disposing)
Parameters:disposingbool

Converts the string representation of an expression to its LambdaExpression equivalent.

C#
public LambdaExpression Parse(string expression)
Parameters:expressionstring

The string expression to be parsed.

Returns:

LambdaExpression

Exceptions:

ExpressionParserException

ExpressionParserException.

Run a parse operation and returns the resulting lambda expression.

C#
public Task<LambdaExpression> ParseAsync(string expression, CancellationToken cancellationToken)
Parameters:expressionstring

The string expression to be parsed.

cancellationTokenCancellationToken

The cancellation token that will be assigned to the new task.

Returns:

Task<LambdaExpression>

Exceptions:

ExpressionParserException

ExpressionParserException.

Run a parse operation and returns the resulting lambda expression.

C#
public Task<LambdaExpression> ParseAsync(string expression)
Parameters:expressionstring

The string expression to be parsed.

Returns:

Task<LambdaExpression>

Exceptions:

ExpressionParserException

ExpressionParserException.

Converts the string representation of an expression to its LambdaExpression equivalent. A return value indicates whether the conversion succeeded or failed.

C#
public bool TryParse(string expression, out LambdaExpression lambda)
Parameters:expressionstring

A string containing an expression to convert.

lambdaLambdaExpression

When this method returns, contains the LambdaExpression equivalent of the s parameter, if the conversion succeeded, or null if the conversion failed. The conversion fails when the supplied expression contains invalid operators or operands;any value originally supplied in result will be overwritten.

Returns:

bool

true if expression was converted successfully; otherwise, false.