Exemple #1
0
 private void AssignIndexedHeaderToEventArgs(int index)
 {
     if (index < StaticTable.Count)
     {
         var header = StaticTable.Get(index);
         _headerEventArgs.Name  = header.Name;
         _headerEventArgs.Value = header.Value;
     }
     else
     {
         //-1 since the index is zero based.
         var header = _dynamicTable.Get(index - StaticTable.Count - 1);
         _headerEventArgs.Name  = header.Name;
         _headerEventArgs.Value = header.Value;
     }
 }
Exemple #2
0
        private IndexedHeader GetIndexedHeader(string name, string wantedValue)
        {
            IndexedHeader header;

            // we need to look in the dynamic table first
            // as we can have the same header as in the static table, but with a defined value.
            if (_dynamicTable.TryGetIndex(name, wantedValue, out header))
            {
                return(header);
            }

            if (StaticTable.TryGetIndex(name, wantedValue, out header))
            {
                return(header);
            }

            return(null);
        }