Mono.CSharp.MetadataImporter.ImportTypeBase C# (CSharp) Method

ImportTypeBase() private method

private ImportTypeBase ( System.TypeSpec spec, Type type ) : void
spec System.TypeSpec
type IKVM.Reflection.Type
return void
        void ImportTypeBase(TypeSpec spec, MetaType type)
        {
            if (spec.Kind == MemberKind.Interface)
                spec.BaseType = TypeManager.object_type;
            else if (type.BaseType != null) {
                TypeSpec base_type;
                if (!IsMissingType (type.BaseType) && type.BaseType.IsGenericType)
                    base_type = CreateType (type.BaseType, new DynamicTypeReader (type), true);
                else
                    base_type = CreateType (type.BaseType);

                spec.BaseType = base_type;
            }

            MetaType[] ifaces;
            #if STATIC
            ifaces = type.__GetDeclaredInterfaces ();
            if (ifaces.Length != 0) {
                foreach (var iface in ifaces)
                    spec.AddInterface (CreateType (iface));
            }

            if (spec.BaseType != null) {
                var bifaces = spec.BaseType.Interfaces;
                if (bifaces != null) {
                    foreach (var iface in bifaces)
                        spec.AddInterface (iface);
                }
            }
            #else
            ifaces = type.GetInterfaces ();

            if (ifaces.Length > 0) {
                foreach (var iface in ifaces) {
                    spec.AddInterface (CreateType (iface));
                }
            }
            #endif

            if (spec.MemberDefinition.TypeParametersCount > 0) {
                foreach (var tp in spec.MemberDefinition.TypeParameters) {
                    ImportTypeParameterTypeConstraints (tp, tp.GetMetaInfo ());
                }
            }
        }

Same methods

MetadataImporter::ImportTypeBase ( Type type ) : void