public Variable FindVariable(string varName) { varName = varName.ToLower(); Variable v = Variables.ContainsKey(varName) ? Variables[varName] : null; if (v == null && ParentContext != null) { v = ParentContext.FindVariable(varName); } if (v != null && Locks.ContainsKey(varName)) { v.Value = Locks[varName].GetValue(); } return(v); }
// Check if this expression term represents a registered variable private bool TryParseVariable(String text) { if (this.Variable != null) { Value = this.Variable.Value; return(true); } else { bool startsWithAtSign = text.StartsWith("@"); Variable variable = executionContext.FindVariable(startsWithAtSign ? text.Substring(1) : text); if (variable != null) { IsStatic = startsWithAtSign; Value = variable.Value; Variable = variable; return(true); } return(false); } }