public GenerateCode ( |
||
interfaces | ||
targetType | ||
Результат |
public virtual Type CreateCustomInterfaceProxy(Type[] interfaces, Type type, GeneratorContext context) { InterfaceProxyGenerator generator = new InterfaceProxyGenerator(_scope, context); return generator.GenerateCode(interfaces, type); }
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 virtual Type CreateInterfaceProxy(Type[] interfaces, Type type) { InterfaceProxyGenerator generator = new InterfaceProxyGenerator(_scope); return generator.GenerateCode(interfaces, type); }