internal virtual IMessageSink CreateEnvoyChain(MarshalByRefObject objectOrProxy)
        {
            // a bare chain would just be the dispatcher sink
            IMessageSink envoyChain = EnvoyTerminatorSink.MessageSink;

            // now loop over properties to add some real sinks.
            // Note: the sinks in the envoy chain should be in mirror image
            // order relative to sinks on the server side
            Object prop  = null;
            int    iSink = 0;

            MarshalByRefObject exposedObj = objectOrProxy;

            while (iSink < _numCtxProps)
            {
                // see if this property wants to contribute a ClientContextSink
                // we have to start chaining in the reverse order
                prop = _ctxProps[iSink];
                IContributeEnvoySink sink = prop as IContributeEnvoySink;
                if (null != sink)
                {
                    // yes, chain the sink ahead of the chain of sinks constructed so far.
                    envoyChain = sink.GetEnvoySink(exposedObj, envoyChain);
                    if (envoyChain == null)
                    {
                        throw new RemotingException(
                                  Environment.GetResourceString(
                                      "Remoting_Contexts_BadProperty"));
                    }
                }
                iSink++;
            }
            return(envoyChain);
        }
Beispiel #2
0
        internal IMessageSink CreateEnvoySink(MarshalByRefObject serverObject)
        {
            IMessageSink sink = EnvoyTerminatorSink.Instance;

            if (context_properties != null)
            {
                foreach (IContextProperty prop in context_properties)
                {
                    IContributeEnvoySink contributor = prop as IContributeEnvoySink;
                    if (contributor != null)
                    {
                        sink = contributor.GetEnvoySink(serverObject, sink);
                    }
                }
            }
            return(sink);
        }
Beispiel #3
0
        internal IMessageSink CreateEnvoySink(MarshalByRefObject serverObject)
        {
            IMessageSink messageSink = EnvoyTerminatorSink.Instance;

            if (this.context_properties != null)
            {
                foreach (object obj in this.context_properties)
                {
                    IContextProperty     contextProperty     = (IContextProperty)obj;
                    IContributeEnvoySink contributeEnvoySink = contextProperty as IContributeEnvoySink;
                    if (contributeEnvoySink != null)
                    {
                        messageSink = contributeEnvoySink.GetEnvoySink(serverObject, messageSink);
                    }
                }
            }
            return(messageSink);
        }
        internal virtual IMessageSink CreateEnvoyChain(MarshalByRefObject objectOrProxy)
        {
            IMessageSink messageSink = EnvoyTerminatorSink.MessageSink;

            for (int i = 0; i < this._numCtxProps; i++)
            {
                object obj = this._ctxProps[i];
                IContributeEnvoySink contributeEnvoySink = obj as IContributeEnvoySink;
                if (contributeEnvoySink != null)
                {
                    messageSink = contributeEnvoySink.GetEnvoySink(objectOrProxy, messageSink);
                    if (messageSink == null)
                    {
                        throw new RemotingException(Environment.GetResourceString("Remoting_Contexts_BadProperty"));
                    }
                }
            }
            return(messageSink);
        }
Beispiel #5
0
        internal virtual IMessageSink CreateEnvoyChain(MarshalByRefObject objectOrProxy)
        {
            IMessageSink       nextSink           = EnvoyTerminatorSink.MessageSink;
            int                index              = 0;
            MarshalByRefObject marshalByRefObject = objectOrProxy;

            for (; index < this._numCtxProps; ++index)
            {
                IContributeEnvoySink contributeEnvoySink = this._ctxProps[index] as IContributeEnvoySink;
                if (contributeEnvoySink != null)
                {
                    nextSink = contributeEnvoySink.GetEnvoySink(marshalByRefObject, nextSink);
                    if (nextSink == null)
                    {
                        throw new RemotingException(Environment.GetResourceString("Remoting_Contexts_BadProperty"));
                    }
                }
            }
            return(nextSink);
        }
        internal virtual IMessageSink CreateEnvoyChain(MarshalByRefObject objectOrProxy)
        {
            IMessageSink       messageSink = EnvoyTerminatorSink.MessageSink;
            object             obj2        = null;
            int                index       = 0;
            MarshalByRefObject obj3        = objectOrProxy;

            while (index < this._numCtxProps)
            {
                obj2 = this._ctxProps[index];
                IContributeEnvoySink sink2 = obj2 as IContributeEnvoySink;
                if (sink2 != null)
                {
                    messageSink = sink2.GetEnvoySink(obj3, messageSink);
                    if (messageSink == null)
                    {
                        throw new RemotingException(Environment.GetResourceString("Remoting_Contexts_BadProperty"));
                    }
                }
                index++;
            }
            return(messageSink);
        }