my class - Class GenericNameValueCollection(Of valueT) inherits from NameObjectCollectionBase
, but when I iterate a collection of this class it lets me use any object in the for each loop , I want it to check the type of object and make sure that the object is the same type as the collection, but the NameObjectCollectionBase GetEnumerator
function is allowing any object type.I also tried adding Implements IEnumerator(Of valueT)
to my class but it is still getting the enumerator from the base class.
How can I restrict the enumerator to my generic type?
thanks.