S
SP
I have created an abstract class inheriting from KeyedCollection<long,
TItem> to use as a base class for my collections. In some derived classes I
am providing a new indexer property for the key (long). I need to access my
collection by index and by key however the new long indexer is used for BOTH
int and long, i.e. myCollection[(int)0] will use the long indexer NOT the
base classes int indexer. Why is that? The workaround is to also define a
new int indexer in the derived class but this should not be necessary.
SP
TItem> to use as a base class for my collections. In some derived classes I
am providing a new indexer property for the key (long). I need to access my
collection by index and by key however the new long indexer is used for BOTH
int and long, i.e. myCollection[(int)0] will use the long indexer NOT the
base classes int indexer. Why is that? The workaround is to also define a
new int indexer in the derived class but this should not be necessary.
SP