Ejemplo n.º 1
0
        public static IDictionary GetChannelSinkProperties(object obj)
        {
            IMessageSink       channelSinkForProxy = ChannelServices.GetChannelSinkForProxy(obj);
            IClientChannelSink clientChannelSink   = channelSinkForProxy as IClientChannelSink;

            if (clientChannelSink != null)
            {
                ArrayList arrayList = new ArrayList();
                do
                {
                    IDictionary properties = clientChannelSink.Properties;
                    if (properties != null)
                    {
                        arrayList.Add(properties);
                    }
                    clientChannelSink = clientChannelSink.NextChannelSink;
                }while (clientChannelSink != null);
                return(new AggregateDictionary(arrayList));
            }
            IDictionary dictionary = channelSinkForProxy as IDictionary;

            if (dictionary != null)
            {
                return(dictionary);
            }
            return(null);
        }
Ejemplo n.º 2
0
        public static IDictionary GetChannelSinkProperties(object obj)
        {
            IMessageSink       channelSinkForProxy = ChannelServices.GetChannelSinkForProxy(obj);
            IClientChannelSink clientChannelSink   = channelSinkForProxy as IClientChannelSink;

            if (clientChannelSink == null)
            {
                return(channelSinkForProxy as IDictionary ?? (IDictionary)null);
            }
            ArrayList arrayList = new ArrayList();

            do
            {
                IDictionary properties = clientChannelSink.Properties;
                if (properties != null)
                {
                    arrayList.Add((object)properties);
                }
                clientChannelSink = clientChannelSink.NextChannelSink;
            }while (clientChannelSink != null);
            return((IDictionary) new AggregateDictionary((ICollection)arrayList));
        }