MZ-Tools Articles Series: BUG: C# indexers are not mapped to EnvDTE80.CodeProperty2 in Visual Studio macros or add-ins

Another bug that I have found today:

BUG: C# indexers are not mapped to EnvDTE80.CodeProperty2 in Visual Studio macros or add-ins
http://www.mztools.com/articles/2009/MZ2009017.aspx

It only happens in VS 2005 and VS 2008. Curiously it is already fixed in VS 2010 Beta 1.

If you need to access the parameter collection of a C# indexer, since EnvDTE.CodeProperty lacks a Parameters property and you can’t get an EnvDTE80.CodeProperty2 (which doesn’t lack it), you need to use the Getter or Setter properties of EnvDTE.CodeProperty and use the EnvDTE.CodeFunction.Parameters property.