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); }
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; }
public bool VariableIsRemovable(Variable variable) { return !(variable is Binding.BoundVariable); }