コード例 #1
0
        ML.TargetObject EvaluateExp(EvaluationContext ctx, string exp)
        {
            ValueReference var;

            try {
                EvaluationContext cctx = ctx.Clone();
                EvaluationOptions ops  = cctx.Options;
                ops.AllowMethodEvaluation = true;
                cctx.Options = ops;
                var          = (ValueReference)Server.Instance.Evaluator.Evaluate(cctx, exp);
                return((ML.TargetObject)var.Value);
            } catch {
                return(null);
            }
        }