Пример #1
0
 public void CopyClasses(InputContext target)
 {
     foreach (var kvp in Classes)
     {
         target.SetClass(kvp.Key, kvp.Value);
     }
 }
Пример #2
0
 public bool SetClass(string name, InputClass defn, bool originator = true)
 {
     if (originator)
     {
         name = name.ToLower();
     }
     if (!Classes.TryGetValue(name, out InputClass c))
     {
         // if we don't find a var in our own scope, check further up the scope tree
         if (ParentScope != null && ParentScope.SetClass(name, defn, false))
         {
             return(true);
         }
         if (originator) // if it isn't found anywhere, define it
         {
             Classes[name] = defn;
         }
         return(false);
     }
     Classes[name] = defn;
     return(true);
 }