Beispiel #1
0
        public override RealProxy CreateProxy(
            ObjRef objRef,
            Type serverType,
            object serverObject,
            Context serverContext)
        {
            var myCustomProxy = new MyProxy(serverType);

            if (serverContext != null)
            {
                RealProxy.SetStubData(myCustomProxy, serverContext);
            }

            if ((!serverType.IsMarshalByRef) && (serverContext == null))
            {
                throw new RemotingException("Bad Type for CreateProxy");
            }

            return(myCustomProxy);
        }
Beispiel #2
0
        public override RealProxy CreateProxy(
            ObjRef objRef,
           Type serverType,
           object serverObject,
           Context serverContext)
        {
            var myCustomProxy = new MyProxy(serverType);

            if (serverContext != null)
                RealProxy.SetStubData(myCustomProxy, serverContext);

            if ((!serverType.IsMarshalByRef) && (serverContext == null))
                throw new RemotingException("Bad Type for CreateProxy");

            return myCustomProxy;
        }