Exemplo n.º 1
0
        internal Type GetMissingTypeOrThrow(Module module, Type declaringType, TypeName typeName)
        {
            if (resolveMissingMembers || module.Assembly.__IsMissing)
            {
                if (missingTypes == null)
                {
                    missingTypes = new Dictionary <ScopedTypeName, Type>();
                }
                ScopedTypeName stn = new ScopedTypeName(declaringType ?? (object)module, typeName);
                Type           type;
                if (!missingTypes.TryGetValue(stn, out type))
                {
                    type = new MissingType(module, declaringType, typeName.Namespace, typeName.Name);
                    missingTypes.Add(stn, type);
                }
                return(type);
            }
            string fullName = TypeNameParser.Escape(typeName.ToString());

            if (declaringType != null)
            {
                fullName = declaringType.FullName + "+" + fullName;
            }
            throw new TypeLoadException(String.Format("Type '{0}' not found in assembly '{1}'", fullName, module.Assembly.FullName));
        }
Exemplo n.º 2
0
        internal Type GetMissingTypeOrThrow(Module module, Type declaringType, TypeName typeName)
        {
            if (resolveMissingMembers || module.Assembly.__IsMissing)
            {
                return(GetMissingType(module, declaringType, typeName));
            }
            string fullName = TypeNameParser.Escape(typeName.ToString());

            if (declaringType != null)
            {
                fullName = declaringType.FullName + "+" + fullName;
            }
            throw new TypeLoadException(String.Format("Type '{0}' not found in assembly '{1}'", fullName, module.Assembly.FullName));
        }