Beispiel #1
0
        private static void GenerateMethod(TypeBuilder typeBuilder, MethodGenerator method)
        {
            var attributes = MethodAttributes.Public | MethodAttributes.HideBySig;

            if (method.IsVirtual)
            {
                attributes |= MethodAttributes.Virtual | MethodAttributes.NewSlot;
            }

            typeBuilder.DefineMethod(method.Name, attributes).GetILGenerator().Emit(OpCodes.Ret);
        }
        private static void GenerateMethod(TypeBuilder typeBuilder, MethodGenerator method)
        {
            var attributes = MethodAttributes.Public | MethodAttributes.HideBySig;

            if (method.IsVirtual)
            {
                attributes |= MethodAttributes.Virtual | MethodAttributes.NewSlot;
            }

            typeBuilder.DefineMethod(method.Name, attributes).GetILGenerator().Emit(OpCodes.Ret);
        }