在C#用户定义的公式 [英] User defined formulas in C#

查看:122
本文介绍了在C#用户定义的公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,其中每个对象的用户可以指定自己的measurepoints。 theese测量的值将被用来对象即A分类 - 需要维修,B - 服务应该在X天内安排,C - 无需服务ATM

I have an application where for each object the user can specify his own measurepoints. The values of theese measurements will then be used to classify the object as i e A - needs service, B - service should be scheduled within X days, C - no service needed ATM

不过theese对象几乎可以是任何东西,也没有办法,我们可以硬编码的测量值应如何汇总到一个分类,我们需要留给用户。

However theese objects can be almost anything and there is no way we can hard code how the measured values should be aggregated to a classification, we need to leave that to the user.

你有没有对我们如何才能提供用户输入自己的公式来进行的方式有什么建议?这并不一定是傻瓜型,我们没有那么多的客户,所以我们可以,只要他们可以解释给我们帮助他们。

Have you any suggestions on how we can provide a way for the user to enter his own formulas for this? It does not have to be idiot-proof, we dont have that many customers so we can assist them as long as they can explain it to us.

推荐答案

回避率表达式求值

你可以给用户的是有效使用,让他们拿出自己的表情变量列表。然后,您可以通过所有的表情时,变量名和值逃离,它会解决所有的表达式的值或真/假。

You could give the users a list of variables that are valid to use and let them come up with their own expressions. You would then pass all the expressions, variable names and values to Flee and it would resolve all expressions to a value or true/false.

这篇关于在C#用户定义的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆