Esempio n. 1
0
        public bool Embed(Type type)
        {
            bool success = false;
            if (type.IsClass&&type.IsPublic)
            {
                string embedName = type.Name;
                AsquellClass attr = getClassAttributes(type);

                if (attr!=null)
                {
                    if (attr.AccessibleName != null)
                        embedName = attr.AccessibleName;
                    else
                    {
                        return embedToGlobal(type);
                    }

                    if (!_opToClass.ContainsKey(embedName))
                    {
                        _opToClass[embedName] = new ReflectedClass(type);
                        success = true;
                    }
                }
            }
            return success;
        }
Esempio n. 2
0
 public bool ContainsMatchingMethods(ReflectedClass reflected)
 {
     foreach (string key in reflected._usableMethods.Keys)
     {
         if (_usableMethods.ContainsKey(key))
             return true;
     }
     return false;
 }
Esempio n. 3
0
 private bool embedToGlobal(Type type)
 {
     if (!isClassEmbedded(type))
     {
         ReflectedClass reflected = new ReflectedClass(type);
         for (int i = 0; i < _globalMethods.Count; i++)
         {
             if (_globalMethods[i].ContainsMatchingMethods(reflected))
             {
                 throw new AmbiguousMatchException("Global Methods already contain a method with the same name!");
             }
         }
         _globalMethods.Add(reflected);
         return true;
     }
     return false;
 }