This is a migrated thread and some comments may be shown as answers.

Expression Evaluation Engine

3 Answers 96 Views
ExpressionEditor
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 15 Jun 2012, 01:09 PM
Is the engine being used to evaluate text expressions built into the RadExpressionEditor, or is it a separate assembly? I would like to use the RadExpressionEditor to build expressions within a WPF environment, but then I need to be able to take that expression text and rebuild the expression in an environment that does not have references to the WPF related assemblies.

Thanks,
Brian

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 19 Jun 2012, 10:44 AM
Hello Brian,

RadExpressionEditor's Expression property exposes a LambdaExpression. You could cast the value of the Expression property to LambdaExpression and call the Compile method of LambdaExpression, which returns a Delegate. 

In regard to your question, you can use the RadExpressionEditor to build expressions within a WPF environment and then Compile() the returned LambdaExpression.  Once you have the result method you could work with it. 

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Brian
Top achievements
Rank 1
answered on 20 Jun 2012, 01:01 PM
Ok, I believe you have answered my question, but let me clarify my situation in order to make sure. I have a WPF application in which I am using the RadExpressionEditor to create a LambdaExpression. I am saving the ExpressionText to a file. Then, I have a console application that I want to load that ExpressionText from, and rebuild that LambdaExpression.

I would like for to be able to rebuild that LambdaExpression without referencing the RadExpressionEditor control so that my console application does have any dependencies on WPF. I would prefer to reference the underlying expression evaluation engine, which I would assume doesn't have any dependencies on WPF. From your answer, it sounds like that expression evaluation engine is built into the RadExpressionEditor, making what I want to do impossible. Is that correct?

Thanks,
Brian
0
Accepted
Dimitrina
Telerik team
answered on 21 Jun 2012, 10:14 AM
Hi Brian,

 Thank you for the additional details. 

I have additionally checked how the engine for the RadExpressionEditor depends on WPF. As it turns out I have to agree with you that you will need the WPF related assemblies.

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ExpressionEditor
Asked by
Brian
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Brian
Top achievements
Rank 1
Share this question
or