O
\(O\)enone
I've written some code that reads the names and values from a
Collections.Specialized.NameValueCollection and displays them on the screen.
However, I'd ideally like to change this code so that it runs against the
abstract Collections.Specialized.NameObjectCollectionBase class, so that all
collections that derive from this base class (which includes
NameValueCollection) will work with my code.
I can extract the keys that have been used to add items to the collections
using the Keys() property which is implemented in the base class, but there
is no similar method to extract the values that are associated with the
keys. As the class appears by definition to hold matching pairs of names
(keys) and values, I would have thought there would be a way to obtain the
values themselves.
Can anyone shed any light on this?
Thanks in advance,
Collections.Specialized.NameValueCollection and displays them on the screen.
However, I'd ideally like to change this code so that it runs against the
abstract Collections.Specialized.NameObjectCollectionBase class, so that all
collections that derive from this base class (which includes
NameValueCollection) will work with my code.
I can extract the keys that have been used to add items to the collections
using the Keys() property which is implemented in the base class, but there
is no similar method to extract the values that are associated with the
keys. As the class appears by definition to hold matching pairs of names
(keys) and values, I would have thought there would be a way to obtain the
values themselves.
Can anyone shed any light on this?
Thanks in advance,