Hi,
Quote:
"Mattias Sjögren" wrote:
Since TypeBuilder derives from Type, you can try using typeBuilder
there.
But if I simply use the TypeBuilder I have, I will end up defining a
function looking like this:
public static A Func(A a) {...}
which is not what I need. How do I, starting from the TypeBuilder for A
that I have, get to a TypeBuilder for array-of-A and managed-pointer-to-A?
Can you give an example? |
You need the get the incomplete types from the ModuleBuilder:
Type arrayType = moduleBuilder.GetType ("A[]");
Type refType = moduleBuilder.GetType ("A&");
MethodBuilder mb = typeBuilder.DefineMethod("Func",
MethodAttributes.Public|MethodAttributes.Static,
arrayType, new Type[]{refType});
Rob