Beispiel #1
0
 public static string EvaluateToString(string code)
 {
     Evaluator eval = new Evaluator(typeof(string), code, staticMethodName);
       return (string) eval.Evaluate(staticMethodName);
 }
Beispiel #2
0
 public static int EvaluateToInteger(string code)
 {
     Evaluator eval = new Evaluator(typeof(int), code, staticMethodName);
       return (int) eval.Evaluate(staticMethodName);
 }
Beispiel #3
0
 public static object EvaluateToObject(string code)
 {
     Evaluator eval = new Evaluator(typeof(object), code, staticMethodName);
       return eval.Evaluate(staticMethodName);
 }
Beispiel #4
0
 public static bool EvaluateToBool(string code)
 {
     Evaluator eval = new Evaluator(typeof(bool), code, staticMethodName);
       return (bool) eval.Evaluate(staticMethodName);
 }