private static TypeGen MakeModuleSlotHolder()
        {
            TypeGen tg = snippetAssembly.DefinePublicType("moduleHolder_" + Interlocked.Increment(ref index), typeof(object));

            tg.AddModuleField(typeof(PythonModule));
            tg.myType.DefineDefaultConstructor(MethodAttributes.Public);
            return(tg);
        }
        internal static TypeGen GenerateModuleType(string moduleName, AssemblyGen ag)
        {
            TypeGen tg = ag.DefinePublicType(moduleName, typeof(CustomFieldIdDict));

            tg.AddModuleField(typeof(PythonModule));
            tg.DefaultConstructor = tg.myType.DefineDefaultConstructor(MethodAttributes.Public);

            return(tg);
        }
Example #3
0
        public TypeGen DefineNestedType(string name, Type parent)
        {
            TypeBuilder tb = myType.DefineNestedType(name, TypeAttributes.NestedPublic);

            tb.SetParent(parent);
            TypeGen ret = new TypeGen(myAssembly, tb);

            nestedTypeGens.Add(ret);

            ret.AddModuleField(typeof(PythonModule));

            return(ret);
        }