internal virtual IMessageSink GetServerContextChain() { if (this._serverContextChain == null) { IMessageSink nextSink = ServerContextTerminatorSink.MessageSink; int index = this._numCtxProps; while (index-- > 0) { IContributeServerContextSink serverContextSink = this._ctxProps[index] as IContributeServerContextSink; if (serverContextSink != null) { nextSink = serverContextSink.GetServerContextSink(nextSink); if (nextSink == null) { throw new RemotingException(Environment.GetResourceString("Remoting_Contexts_BadProperty")); } } } lock (this) { if (this._serverContextChain == null) { this._serverContextChain = nextSink; } } } return(this._serverContextChain); }
internal IMessageSink GetServerContextSinkChain() { if (server_context_sink_chain == null) { if (default_server_context_sink == null) { default_server_context_sink = new ServerContextTerminatorSink(); } server_context_sink_chain = default_server_context_sink; if (context_properties != null) { // Enumerate in reverse order for (int n = context_properties.Count - 1; n >= 0; n--) { IContributeServerContextSink contributor = context_properties[n] as IContributeServerContextSink; if (contributor != null) { server_context_sink_chain = contributor.GetServerContextSink(server_context_sink_chain); } } } } return(server_context_sink_chain); }
internal virtual IMessageSink GetServerContextChain() { if (this._serverContextChain == null) { IMessageSink messageSink = ServerContextTerminatorSink.MessageSink; int numCtxProps = this._numCtxProps; while (numCtxProps-- > 0) { object obj = this._ctxProps[numCtxProps]; IContributeServerContextSink contributeServerContextSink = obj as IContributeServerContextSink; if (contributeServerContextSink != null) { messageSink = contributeServerContextSink.GetServerContextSink(messageSink); if (messageSink == null) { throw new RemotingException(Environment.GetResourceString("Remoting_Contexts_BadProperty")); } } } lock (this) { if (this._serverContextChain == null) { this._serverContextChain = messageSink; } } } return(this._serverContextChain); }
internal virtual IMessageSink GetServerContextChain() { if (this._serverContextChain == null) { IMessageSink messageSink = ServerContextTerminatorSink.MessageSink; object obj2 = null; int index = this._numCtxProps; while (index-- > 0) { obj2 = this._ctxProps[index]; IContributeServerContextSink sink2 = obj2 as IContributeServerContextSink; if (sink2 != null) { messageSink = sink2.GetServerContextSink(messageSink); if (messageSink == null) { throw new RemotingException(Environment.GetResourceString("Remoting_Contexts_BadProperty")); } } } lock (this) { if (this._serverContextChain == null) { this._serverContextChain = messageSink; } } } return(this._serverContextChain); }
internal virtual IMessageSink GetServerContextChain() { if (_serverContextChain == null) { // a bare chain would have just this one sink. IMessageSink newServerContextChain = ServerContextTerminatorSink.MessageSink; // now loop over properties to add some real sinks. Object prop = null; int iSink = _numCtxProps; while (iSink-- > 0) { // see if this property wants to contribute a ServerContextSink // we have to start chaining in the reverse order prop = _ctxProps[iSink]; IContributeServerContextSink sink = prop as IContributeServerContextSink; if (null != sink) { // yes, chain the sink ahead of the chain of sinks constructed so far. newServerContextChain = sink.GetServerContextSink(newServerContextChain); if (newServerContextChain == null) { throw new RemotingException( Environment.GetResourceString( "Remoting_Contexts_BadProperty")); } } } lock (this) { if (_serverContextChain == null) { _serverContextChain = newServerContextChain; } } } return(_serverContextChain); }
internal IMessageSink GetServerContextSinkChain() { if (this.server_context_sink_chain == null) { if (Context.default_server_context_sink == null) { Context.default_server_context_sink = new ServerContextTerminatorSink(); } this.server_context_sink_chain = Context.default_server_context_sink; if (this.context_properties != null) { for (int i = this.context_properties.Count - 1; i >= 0; i--) { IContributeServerContextSink contributeServerContextSink = this.context_properties[i] as IContributeServerContextSink; if (contributeServerContextSink != null) { this.server_context_sink_chain = contributeServerContextSink.GetServerContextSink(this.server_context_sink_chain); } } } } return(this.server_context_sink_chain); }