IsSender() private method

private IsSender ( int index ) : bool
index int
return bool
示例#1
0
        } // RegisteredChannels

        internal static IMessageSink CreateMessageSink(String url, Object data, out String objectURI)
        {
            BCLDebug.Trace("REMOTE", "ChannelServices::CreateMessageSink for url " + url + "\n");
            IMessageSink msgSink = null;

            objectURI = null;

            RegisteredChannelList regChnlList = s_registeredChannels;
            int count = regChnlList.Count;

            for (int i = 0; i < count; i++)
            {
                if (regChnlList.IsSender(i))
                {
                    IChannelSender chnl = (IChannelSender)regChnlList.GetChannel(i);
                    msgSink = chnl.CreateMessageSink(url, data, out objectURI);

                    if (msgSink != null)
                    {
                        break;
                    }
                }
            }

            // If the object uri has not been set, set it to the url as
            // default value
            if (null == objectURI)
            {
                objectURI = url;
            }

            return(msgSink);
        } // CreateMessageSink
示例#2
0
        internal static IMessageSink CreateMessageSink(string url, object data, out string objectURI)
        {
            IMessageSink messageSink = (IMessageSink)null;

            objectURI = (string)null;
            RegisteredChannelList registeredChannelList = ChannelServices.s_registeredChannels;
            int count = registeredChannelList.Count;

            for (int index = 0; index < count; ++index)
            {
                if (registeredChannelList.IsSender(index))
                {
                    messageSink = ((IChannelSender)registeredChannelList.GetChannel(index)).CreateMessageSink(url, data, out objectURI);
                    if (messageSink != null)
                    {
                        break;
                    }
                }
            }
            if (objectURI == null)
            {
                objectURI = url;
            }
            return(messageSink);
        }
        internal static IMessageSink CreateMessageSink(string url, object data, out string objectURI)
        {
            IMessageSink sink = null;

            objectURI = null;
            RegisteredChannelList list = s_registeredChannels;
            int count = list.Count;

            for (int i = 0; i < count; i++)
            {
                if (list.IsSender(i))
                {
                    sink = ((IChannelSender)list.GetChannel(i)).CreateMessageSink(url, data, out objectURI);
                    if (sink != null)
                    {
                        break;
                    }
                }
            }
            if (objectURI == null)
            {
                objectURI = url;
            }
            return(sink);
        }