コード例 #1
0
        public string GetVar(string name)
        {
            string value;

            if (_varsDic != null && _varsDic.TryGetValue(name, out value))
            {
                return(value);
            }
            if (_parent != null)
            {
                return(_parent.GetVar(name));
            }
            throw new ArgumentException("Variable '" + name + "' is not defined.");
        }
コード例 #2
0
 private string SubstVars(VarsContainer vars, string str)
 {
     return(_varsRegex.Replace(str,
                               match => vars.GetVar(match.Groups[1].Value)));
 }