0

A C# application may contain indexer declaration. Based in this concept, I try to find advantages to customzing the Indexation Strategy by re-implementing a class's indexers instead of use it as a type in a collection (Like List, Enumerable...)

I asked here for this customization manner, thanks to xanatos who gives me a good answer.

But I'm still not understanding

  1. what are the advantages of the re-implemention of indexers?
  2. In which cases, it is necessary to re-implement it?
Community
  • 1
  • 1
Lamloumi Afif
  • 8,941
  • 26
  • 98
  • 191
  • 3
    I'm not clear on what you're asking. If you want to change the behavior of an indexer, that's when it'd be necessary to re-implement one. For example, you may want something like a `CaseInsensitiveDictionary : Dictionary` – Jacob Mar 11 '15 at 15:35
  • @Jacob Sorry but I can't understand your example , can u plz elaborate it more as an answer in which you a short list in cases when it'd be necessary to re-implement an indexer – Lamloumi Afif Mar 11 '15 at 15:41
  • http://stackoverflow.com/questions/2185071/real-world-use-cases-for-c-sharp-indexers has good examples of custom indexers. – Jacob Mar 12 '15 at 00:05

0 Answers0