internal void AddImport(Type type, Hashtable types)
{
if (((type != null) && !TypeScope.IsKnownType(type)) && (types[type] == null))
{
types[type] = type;
Type baseType = type.BaseType;
if (baseType != null)
{
this.AddImport(baseType, types);
}
Type declaringType = type.DeclaringType;
if (declaringType != null)
{
this.AddImport(declaringType, types);
}
foreach (Type type4 in type.GetInterfaces())
{
this.AddImport(type4, types);
}
ConstructorInfo[] constructors = type.GetConstructors();
for (int i = 0; i < constructors.Length; i++)
{
ParameterInfo[] parameters = constructors[i].GetParameters();
for (int j = 0; j < parameters.Length; j++)
{
this.AddImport(parameters[j].ParameterType, types);
}
}
if (type.IsGenericType)
{
Type[] genericArguments = type.GetGenericArguments();
for (int k = 0; k < genericArguments.Length; k++)
{
this.AddImport(genericArguments[k], types);
}
}
TempAssembly.FileIOPermission.Assert();
Assembly a = type.Module.Assembly;
if (DynamicAssemblies.IsTypeDynamic(type))
{
DynamicAssemblies.Add(a);
}
else
{
object[] customAttributes = type.GetCustomAttributes(typeof(TypeForwardedFromAttribute), false);
if (customAttributes.Length > 0)
{
TypeForwardedFromAttribute attribute = customAttributes[0] as TypeForwardedFromAttribute;
Assembly assembly2 = Assembly.Load(attribute.AssemblyFullName);
this.imports[assembly2] = assembly2.Location;
}
this.imports[a] = a.Location;
}
}
}