PropertyChanged for indexer property

According to this blog entry, you have to use “Item[]”. Item being the name of the property generated by the compiler when using an indexer. If you want to be explicit, you can decorate the indexer property with an IndexerName attribute. That would make the code look like: public class IndexerProvider : INotifyPropertyChanged { [IndexerName … Read more

Eclipse CDT indexer does not know C++11 containers

Setting up **__GXX_EXPERIMENTAL_CXX0X__** does not help in my case (Jul 2014, Eclipse Kepler 20130919, Ubuntu 12.04). To fix C++11 syntax highlighting go to: Project Properties –> C/C++ General –> Paths and Symbols –> Symbols –> GNU C++ and overwrite the symbol (i.e. add new symbol): __cplusplus with value 201103L UPDATED: If you use newer version … Read more

Real world use cases for C# indexers?

The way I look at indexers is that (rightly or wrongly!), accessing something by index should be more efficient than accessing it any other way, because in some way, shape or form, the class whose indexer I’m using stores some form of index that allows it to quickly lookup values when accessed that way. The … Read more

Static Indexers?

I believe it was considered not to be terribly useful. I think it’s a shame too – an example I tend to use is Encoding, where Encoding.GetEncoding(“foo”) could be Encoding[“Foo”]. I don’t think it would come up very often, but aside from anything else it just feels a little inconsistent not to be available. I … Read more