Exemplo n.º 1
0
 public static bool EvaluateToBool(string code)
 {
     Evaluator eval = new Evaluator(typeof(bool), code, staticMethodName);
     bool result = (bool)eval.Evaluate(staticMethodName);
     eval = null;
     return result;
 }
Exemplo n.º 2
0
 public static string EvaluateToString(string code)
 {
     Evaluator eval = new Evaluator(typeof(string), code, staticMethodName);
     return (string)eval.Evaluate(staticMethodName);
 }
Exemplo n.º 3
0
 public static object EvaluateToObject(string code)
 {
     Evaluator eval = new Evaluator(typeof(object), code, staticMethodName);
     return eval.Evaluate(staticMethodName);
 }
Exemplo n.º 4
0
 public static int EvaluateToInteger(string code)
 {
     Evaluator eval = new Evaluator(typeof(int), code, staticMethodName);
     return (int)eval.Evaluate(staticMethodName);
 }
Exemplo n.º 5
0
 public static double EvaluateToDouble(string code)
 {
     Evaluator eval = new Evaluator(typeof(double), code, staticMethodName);
     return (double)eval.Evaluate(staticMethodName);
 }