Пример #1
0
        Type ITypeContext.GetType(TypeName typeName)
        {
            if (typeName.Namespace == null && Inbuilts.TryGetValue(typeName.Name, out Type t))
            {
                return(t);
            }
            var type = Type.GetType(typeName.FullName, false);

            if (type != null)
            {
                return(type);
            }
            foreach (var item in AppDomain.CurrentDomain.GetAssemblies())
            {
                type = item.GetType(typeName.FullName, false);
                if (type != null)
                {
                    return(type);
                }
            }
            return(null);
        }
Пример #2
0
 public bool TryGetType(string name, out Type type)
 {
     return(Inbuilts.TryGetValue(name, out type));
 }