SetLogicalCallContext() private méthode

private SetLogicalCallContext ( LogicalCallContext ctx ) : LogicalCallContext
ctx LogicalCallContext
Résultat LogicalCallContext
Exemple #1
0
        internal override void SetSpecialKey(int keyNum, object value)
        {
            ReturnMessage  message  = this._crmsg as ReturnMessage;
            MethodResponse response = this._crmsg as MethodResponse;

            switch (keyNum)
            {
            case 0:
                if (message == null)
                {
                    if (response == null)
                    {
                        throw new RemotingException(Environment.GetResourceString("Remoting_Message_BadType"));
                    }
                    response.Uri = (string)value;
                    return;
                }
                message.Uri = (string)value;
                return;

            case 1:
                if (message == null)
                {
                    if (response == null)
                    {
                        throw new RemotingException(Environment.GetResourceString("Remoting_Message_BadType"));
                    }
                    response.SetLogicalCallContext((LogicalCallContext)value);
                    return;
                }
                message.SetLogicalCallContext((LogicalCallContext)value);
                return;
            }
            throw new RemotingException(Environment.GetResourceString("Remoting_Default"));
        }
        internal override void SetSpecialKey(int keyNum, object value)
        {
            ReturnMessage  returnMessage  = this._mrmsg as ReturnMessage;
            MethodResponse methodResponse = this._mrmsg as MethodResponse;

            if (keyNum != 0)
            {
                if (keyNum != 1)
                {
                    throw new RemotingException(Environment.GetResourceString("Remoting_Default"));
                }
                if (returnMessage != null)
                {
                    returnMessage.SetLogicalCallContext((LogicalCallContext)value);
                    return;
                }
                if (methodResponse != null)
                {
                    methodResponse.SetLogicalCallContext((LogicalCallContext)value);
                    return;
                }
                throw new RemotingException(Environment.GetResourceString("Remoting_Message_BadType"));
            }
            else
            {
                if (returnMessage != null)
                {
                    returnMessage.Uri = (string)value;
                    return;
                }
                if (methodResponse != null)
                {
                    methodResponse.Uri = (string)value;
                    return;
                }
                throw new RemotingException(Environment.GetResourceString("Remoting_Message_BadType"));
            }
        }