Пример #1
0
 public void AddVariable(string name, string content)
 {
     if (!GlobalVariables.ContainsKey(name.ToLower()) && !LocalVariables.ContainsKey(name.ToLower()))
     {
         var newVar = new Variable(name, content);
         LocalVars.Add(newVar.Name.ToLower(), newVar);
     }
 }
Пример #2
0
        public string RenameVariable(string oldName, string newName)
        {
            string currentVarName = oldName;

            if (!GlobalVariables.ContainsKey(newName.ToLower()) && !LocalVariables.ContainsKey(newName.ToLower()))
            {
                LocalVars.Add(newName.ToLower(), LocalVariables[oldName.ToLower()]);
                LocalVars[newName.ToLower()].Name = newName;
                RemoveVariable(oldName.ToLower());
                currentVarName = newName;
            }

            return(currentVarName);
        }