System.Runtime.Remoting.Channels.BaseTransportHeaders.this C# (CSharp) Method

this() public method

public this ( Object key ) : Object
key Object
return Object
        public Object this[Object key]
        {
            get 
            {
                String strKey = key as String;
                if (strKey != null)
                {
                    int index = MapHeaderNameToIndex(strKey);
                    if (index != -1)
                        return GetValueFromHeaderIndex(index);
                }
            
                if (_otherHeaders != null)
                    return _otherHeaders[key];

                return null;
            } // get

            set
            {
                bool bSet = false;
            
                String strKey = key as String;
                if (strKey != null)
                {
                    int index = MapHeaderNameToIndex(strKey);
                    if (index != -1)     
                    {
                        SetValueFromHeaderIndex(index, value);
                        bSet = true;
                    }
                }

                if (!bSet)
                {
                    if (_otherHeaders == null)
                        _otherHeaders = new TransportHeaders();
                    _otherHeaders[key] = value;
                }
            } // set
        } // Object this[Object key]