public object RecreateInterfaceProxy(SerializationInfo info, StreamingContext context) { object proxy = null; GeneratorContext genContext = new GeneratorContext(); foreach (object mixin in _mixins) { genContext.AddMixinInstance(mixin); } InterfaceProxyGenerator gen = new InterfaceProxyGenerator(_scope, genContext); object target = info.GetValue("__target", typeof(object)); if (_mixins.Length == 0) { Type proxy_type = gen.GenerateCode(_interfaces, target.GetType()); proxy = Activator.CreateInstance(proxy_type, new object[] { _interceptor, target }); } else { Type proxy_type = gen.GenerateCode(_interfaces, target.GetType()); proxy = Activator.CreateInstance(proxy_type, new object[] { _interceptor, target, genContext.MixinsAsArray() }); } return(proxy); }
public object RecreateInterfaceProxy(SerializationInfo info, StreamingContext context) { GeneratorContext context2 = new GeneratorContext(); foreach (object obj3 in this._mixins) { context2.AddMixinInstance(obj3); } InterfaceProxyGenerator generator = new InterfaceProxyGenerator(_scope, context2); object obj4 = info.GetValue("__target", typeof(object)); if (this._mixins.Length == 0) { return(Activator.CreateInstance(generator.GenerateCode(this._interfaces, obj4.GetType()), new object[] { this._interceptor, obj4 })); } return(Activator.CreateInstance(generator.GenerateCode(this._interfaces, obj4.GetType()), new object[] { this._interceptor, obj4, context2.MixinsAsArray() })); }
public virtual Type CreateCustomInterfaceProxy(Type[] interfaces, Type type, GeneratorContext context) { InterfaceProxyGenerator generator = new InterfaceProxyGenerator(_scope, context); return(generator.GenerateCode(interfaces, type)); }
public virtual Type CreateInterfaceProxy(Type[] interfaces, Type type) { InterfaceProxyGenerator generator = new InterfaceProxyGenerator(_scope); return(generator.GenerateCode(interfaces, type)); }