Example #1
0
        public static EvalException CreateEvalException01()
        {
            string        varName       = string.Empty;
            EvalException evalException = EvalException.VariableNotExist(varName);

            return(evalException);
        }
Example #2
0
        public void TestVariableNotExist01()
        {
            string        varName       = string.Empty;
            EvalException evalException = EvalException.VariableNotExist(varName);

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record <string>(delegate { return((string)evalException.HelpLink); });
            recorder.Record <string>(delegate { return((string)evalException.Message); });
            recorder.Record <string>(delegate { return((string)evalException.Source); });
            recorder.Record <string>(delegate { return((string)evalException.StackTrace); });
            recorder.FinishRecording();
            #endregion
        }
Example #3
0
        internal override Result Eval(Evaluator evaluater, Result[] argArray)
        {
            if (!evaluater.VariableHolder.Exists(this.Name))
            {
                throw EvalException.VariableNotExist(this.Name);
            }

            object o = evaluater.VariableHolder.GetVariable(this.Name);

            if (o == null)
            {
                return(new Result(null, null));
            }
            return(new Result(o.GetType(), o));
        }