Пример #1
0
        public void AddVariable(Variable variable, string identifier)
        {
            identifier = identifier.ToLower();

            if (!identifier.StartsWith("$"))
            {
                identifier = "$" + identifier;
            }

            if (_vars.ContainsKey(identifier))
            {
                _vars.Remove(identifier);
            }

            _vars.Add(identifier, variable);
        }
Пример #2
0
        private Variable GetOrCreateVariable(string identifier)
        {
            Variable variable;

            if (vars.ContainsKey(identifier))
            {
                variable = GetVariable(identifier);
            }
            else
            {
                variable = new Variable {Name = identifier};
                AddVariable(variable, identifier);
            }
            return variable;
        }
Пример #3
0
 public bool VariableIsRemovable(Variable variable)
 {
     return !(variable is Binding.BoundVariable);
 }