public void ImplementProxy(TypeBuilder typeBuilder)
        {
            // Implement the IAsyncInterceptorProxy interface
            typeBuilder.AddInterfaceImplementation(typeof(IAsyncInterceptorProxy));

            MethodsField = ImplementorHelper.ImplementProperty(typeBuilder, "Methods", typeof(MethodInfo[]),
                                                               typeof(IAsyncInterceptorProxy));

            InterceptorField = ImplementorHelper.ImplementProperty(typeBuilder, "Interceptor",
                                                                   typeof(IAsyncInterceptor),
                                                                   typeof(IAsyncInterceptorProxy));
        }
Пример #2
0
        public void ImplementProxy(TypeBuilder typeBuilder)
        {
            // Implement the IAsyncInterceptorProxy interface
            typeBuilder.AddInterfaceImplementation(typeof(IEventInterceptorProxy));

            InterceptorField = ImplementorHelper.ImplementProperty(typeBuilder,
                                                                   nameof(IEventInterceptorProxy.Interceptor),
                                                                   typeof(IEventInterceptor), typeof(IEventInterceptorProxy));

            EventsField = ImplementorHelper.ImplementProperty(typeBuilder, nameof(IEventInterceptorProxy.Events),
                                                              typeof(EventInfo[]), typeof(IEventInterceptorProxy));
        }