PropertyInfo : is the property an indexer?

Solution 1:

Call PropertyInfo.GetIndexParameters - if the returned array is empty, it's not an indexer.

Solution 2:

Another option is to use:

myType.GetProperties().Except(myType.GetDefaultMembers().OfType<PropertyInfo>());

GetDefaultMembers will return all the compiler generated indexers in C#. This has the advantage of not needing to reflect on each individual property in order to find out which ones are indexers.

This might not be a general solution for all allowed .NET framework languages, but I am currently not aware of any counter-examples.