Пример #1
0
        public override RealProxy CreateProxy(ObjRef objRef, Type serverType, object serverObject, Context serverContext)
        {
            TransparentProxy proxy = new TransparentProxy(serverType);

            if (serverContext != null)
            {
                RealProxy.SetStubData(proxy, serverContext);
            }
            return(proxy);
        }
Пример #2
0
        public override MarshalByRefObject CreateInstance(Type serverType)
        {
            ProxyServer      proxyInvoker;
            TransparentProxy proxy;

            lock (TransparentProxyAttribute.lockProxyServerField)
            {
                proxyInvoker = TransparentProxyAttribute.proxyServer;
                if (proxyInvoker != null)
                {
                    proxy = new TransparentProxy(serverType, proxyInvoker);
                }
                else
                {
                    proxy = new TransparentProxy(serverType);
                }
            }
            var transparentProxy = proxy.GetTransparentProxy() as MarshalByRefObject;

            return(transparentProxy);
        }