示例#1
0
 /// <summary>
 /// Creates a method.
 /// </summary>
 /// <param name="typeBuilder">A type builder.</param>
 /// <param name="name">The name of the method.</param>
 /// <returns>A method builder instance.</returns>
 public static IMethodBuilder NewMethod <TReturn>(this ITypeBuilder typeBuilder, string name)
 {
     return(typeBuilder.NewMethod(
                name,
                MethodAttributes.Public,
                CallingConventions.HasThis,
                typeof(TReturn)));
 }