private static PropertyInfo GetTypedIndexer(Type type)
{
PropertyInfo indexer = null;
if (!IsListBasedType(type)) {
return null;
}
System.Reflection.PropertyInfo[] props = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
for (int idx = 0; idx < props.Length; idx++) {
if (props[idx].GetIndexParameters().Length > 0 && props[idx].PropertyType != typeof(object)) {
indexer = props[idx];
//Prefer the standard indexer, if there is one
if (indexer.Name == "Item") {
break;
}
}
}
return indexer;
}