예제 #1
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        protected virtual TypeBuilder CreateTypeBuilder(DynamicModule module, string classFullName, Type baseType, ClassType containingClass)
        {
            return(module.ModuleBuilder.DefineType(classFullName, DefaultTypeAtributes, baseType));
        }
예제 #2
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        protected ClassType(DynamicModule module, TypeKey key, string classFullName, Type baseType, ClassType containingClass)
        {
            var resolvedBaseType = TypeTemplate.Resolve(baseType);

            m_Key     = key;
            m_Module  = module;
            m_Writers = new List <ClassWriterBase>();
            m_Members = new List <MemberBase>();
            m_MembersByDeclarations = new Dictionary <MemberInfo, MemberBase>();
            m_MembersByName         = new Dictionary <string, MemberBase>();
            m_FactoryMethods        = new List <MethodInfo>();
            m_MemberNames           = new UniqueNameSet();
            m_NotImplementedMembers = new HashSet <MemberInfo>();
            m_NotImplementedMembers.UnionWith(TypeMemberCache.Of(resolvedBaseType).ImplementableMembers);
            m_CompiledType     = null;
            m_DependencyFields = new List <FieldMember>();
            m_NestedClasses    = new List <NestedClassType>();

            //m_TypeBuilder = module.ModuleBuilder.DefineType(classFullName, DefaultTypeAtributes, resolvedBaseType);

            // ReSharper disable once DoNotCallOverridableMethodsInConstructor
            m_TypeBuilder = CreateTypeBuilder(module, classFullName, resolvedBaseType, containingClass);
        }