Ejemplo n.º 1
0
        public RealObject(IReflectionCaller remoteCaller, object target)
        {
            this.identity = Guid.NewGuid();

            this.remoteCaller = remoteCaller;
            this.target       = target;

            RegisterHandlers();
        }
Ejemplo n.º 2
0
        public object CreateProxy(Type targetType, Guid identity, IReflectionCaller remoteCaller)
        {
            Type[] interfaces = GetTopInterfaces(targetType);

            ProxyGenerationOptions options = new ProxyGenerationOptions();

            options.BaseTypeForInterfaceProxy = typeof(ProxyObject);
            ProxyGenerator generator = new ProxyGenerator();
            ProxyObject    proxy     = (ProxyObject)generator.CreateInterfaceProxyWithoutTarget(interfaces[0], interfaces.Skip(1).ToArray(), options, Interceptor);

            proxy.Init(identity, remoteCaller);
            return(proxy);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Set the object identiy
 /// </summary>
 /// <param name="identity"></param>
 /// <param name="remoteCaller"></param>
 public void Init(Guid identity, IReflectionCaller remoteCaller)
 {
     this.indentity    = identity;
     this.remoteCaller = remoteCaller;
 }
Ejemplo n.º 4
0
 public T CreateProxy <T>(Guid identity, IReflectionCaller remoteCaller)
 {
     return((T)CreateProxy(typeof(T), identity, remoteCaller));
 }