indexers and reflection

  • Thread starter Thread starter Iain
  • Start date Start date
I

Iain

I'm writing some reflection code which resolves the value of a complex
expression (e.g. MyInfo.Customers[3].Orders["Order305"].Date), against a
specific object.

I'm struggling a bit with indexers.

I'm not entirely sure how I can find the indexer(s?) on an object. although
there is a default name 'Item' it doesn't have to be that, and there seems
to be no 'GetIndexers' method on Type (I know that an indexer is a property,
but which one?).

Anyone help?

Iain
 
Iain,
I'm struggling a bit with indexers.

I'm not entirely sure how I can find the indexer(s?) on an object. although
there is a default name 'Item' it doesn't have to be that, and there seems
to be no 'GetIndexers' method on Type (I know that an indexer is a property,
but which one?).

Anyone help?


Look for the System.Reflection.DefaultMemberAttribute on the type.



Mattias
 
Back
Top