Пример #1
0
        protected virtual void PreProcessMethod(MethodInfo method)
        {
            MethodInfo callbackMethod = GenerateCallbackMethodIfNecessary(method, null);

            EasyCallable callable = MainTypeBuilder.CreateCallable(method.ReturnType, method.GetParameters());

            _method2Delegate[method] = callable;

            FieldReference field = MainTypeBuilder.CreateField(
                String.Format("_cached_{0}", callable.ID),
                callable.TypeBuilder);

            RegisterDelegateFieldToBeInitialized(method, field, callable, callbackMethod);
        }
Пример #2
0
 protected override void GenerateFields()
 {
     base.GenerateFields();
     _targetField = MainTypeBuilder.CreateField("__target", typeof(object));
 }