Beispiel #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));
        }
Beispiel #2
0
 internal bool ResolveMissingTypeIsValueType(MissingType missingType)
 {
     if (missingTypeIsValueType != null)
     {
         return(missingTypeIsValueType(missingType));
     }
     throw new MissingMemberException(missingType);
 }
Beispiel #3
0
        private Type GetMissingType(Module module, Type declaringType, TypeName typeName)
        {
            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);
        }
Beispiel #4
0
        private Type GetMissingType(Module requester, Module module, Type declaringType, TypeName typeName)
        {
            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);
            }
            if (ResolvedMissingMember != null && !module.Assembly.__IsMissing)
            {
                ResolvedMissingMember(requester, type);
            }
            return(type);
        }
Beispiel #5
0
		internal override Type ResolveNestedType(TypeName typeName)
		{
			if (types == null)
			{
				types = new Dictionary<TypeName, Type>();
			}
			Type type;
			if (!types.TryGetValue(typeName, out type))
			{
				type = new MissingType(module, this, typeName.Namespace, typeName.Name);
				types.Add(typeName, type);
			}
			return type;
		}
Beispiel #6
0
		internal override Type GetMissingType(TypeName name)
		{
			Type type;
			if (!types.TryGetValue(name, out type))
			{
				type = new MissingType(module, null, name.Namespace, name.Name);
				types.Add(name, type);
			}
			return type;
		}