Exemple #1
0
        public static IMessage Activate(RemotingProxy proxy, ConstructionCall ctorCall)
        {
            IMessage response;

            ctorCall.SourceProxy = proxy;

            if (Thread.CurrentContext.HasExitSinks && !ctorCall.IsContextOk)
            {
                response = Thread.CurrentContext.GetClientContextSinkChain().SyncProcessMessage(ctorCall);
            }
            else
            {
                response = RemoteActivate(ctorCall);
            }

            if (response is IConstructionReturnMessage && ((IConstructionReturnMessage)response).Exception == null && proxy.ObjectIdentity == null)
            {
                                #if !DISABLE_REMOTING
                Identity identity = RemotingServices.GetMessageTargetIdentity(ctorCall);
                proxy.AttachIdentity(identity);
                                #endif
            }

            return(response);
        }
        public static IMessage Activate(RemotingProxy proxy, ConstructionCall ctorCall)
        {
            ctorCall.SourceProxy = proxy;
            IMessage message;

            if (Thread.CurrentContext.HasExitSinks && !ctorCall.IsContextOk)
            {
                message = Thread.CurrentContext.GetClientContextSinkChain().SyncProcessMessage(ctorCall);
            }
            else
            {
                message = ActivationServices.RemoteActivate(ctorCall);
            }
            if (message is IConstructionReturnMessage && ((IConstructionReturnMessage)message).Exception == null && proxy.ObjectIdentity == null)
            {
                Identity messageTargetIdentity = RemotingServices.GetMessageTargetIdentity(ctorCall);
                proxy.AttachIdentity(messageTargetIdentity);
            }
            return(message);
        }