我正在使用反射编写克隆方法。如何使用反射检测属性是索引属性?例如:
public string[] Items
{
   get;
   set;
}
到目前为止我的方法:
public static T Clone<T>(T from, List<string> propertiesToIgnore) where T : new()
{
    T to = new T();
    Type myType = from.GetType();
    PropertyInfo[] myProperties = myType.GetProperties();
    for (int i = 0; i < myProperties.Length; i++)
    {
        if (myProperties[i].CanWrite && !propertiesToIgnore.Contains(myProperties[i].Name))
        {
            myProperties[i].SetValue(to,myProperties[i].GetValue(from,null),null);
        }
    }
    return to;
}