Skip to content

Instantly share code, notes, and snippets.

@jcbozonier
Created October 31, 2009 16:13
Show Gist options
  • Select an option

  • Save jcbozonier/223131 to your computer and use it in GitHub Desktop.

Select an option

Save jcbozonier/223131 to your computer and use it in GitHub Desktop.
private static void _GenerateMethod_Without_Return(TypeBuilder typeBuilder, string firstMethodName, Type[] parameterTypes)
{
var methodBuilder = typeBuilder.DefineMethod(
firstMethodName,
MethodAttributes.Public | MethodAttributes.Virtual,
typeof (void),
parameterTypes);
var methodIl = methodBuilder.GetILGenerator();
methodIl.Emit(OpCodes.Ret);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment