Esempio n. 1
0
 public bool GetMethodOnIt(CoolType type, string method, out CoolMethod CoolMethod)
 {
     if (!Methods.ContainsKey(type))
     {
         Methods[type] = new List <CoolMethod>();
     }
     CoolMethod = Methods[type].FirstOrDefault(x => x.Name == method);
     return(CoolMethod != null);
 }
Esempio n. 2
0
 public bool GetMethodIfDef(CoolType type, string method, out CoolMethod CoolMethod)
 {
     CoolMethod = new NullMethod(method);
     if (type is NullType)
     {
         return(true);
     }
     if (type is SelfType selftype)
     {
         return(GetMethodIfDef(selftype.ContextType, method, out CoolMethod));
     }
     if (GetMethodOnIt(type, method, out CoolMethod))
     {
         return(true);
     }
     if (type.Parent != null)
     {
         return(GetMethodIfDef(type.Parent, method, out CoolMethod));
     }
     return(false);
 }