public virtual void GenerateMethod(PropertyInfo pi, MethodInfo mi, ILGenerator gen) { gen.Emit(OpCodes.Ldarg_0); // this gen.Emit(OpCodes.Ldc_I4, _index); // _index; gen.Emit(OpCodes.Stfld, _mc.MethodIndexField); // [s1]._methodIndex = [s0]; gen.EmitLdDefaultValue(mi.ReturnType); gen.Emit(OpCodes.Ret); ++_index; }
public virtual void PushDefaultReturnValue(ILGenerator gen, Type returnType) { if (returnType.IsInterface) { var pcd = SafeFactory.CreateSafeNullProxyDescriptorFor(returnType); var proxyType = _proxyModule.GetTypeFromProxyClassDescriptor(pcd); StaticInstanceMixin.PushInstanceOnStackFor(proxyType,gen); } else gen.EmitLdDefaultValue(returnType); }