<p>I am writing a Clone method using reflection. How do I detect that a property is an indexed property using reflection?  For example:</p>

<pre><code>public string[] Items
{
   get;
   set;
}
</code></pre>

<p>My method so far:</p>

<pre><code>public static T Clone&lt;T&gt;(T from, List&lt;string&gt; propertiesToIgnore) where T : new()
{
    T to = new T();

    Type myType = from.GetType();

    PropertyInfo[] myProperties = myType.GetProperties();

    for (int i = 0; i &lt; myProperties.Length; i++)
    {
        if (myProperties[i].CanWrite &amp;&amp; !propertiesToIgnore.Contains(myProperties[i].Name))
        {
            myProperties[i].SetValue(to,myProperties[i].GetValue(from,null),null);
        }
    }

    return to;
}
</code></pre>

```
```
if (propertyInfo.GetIndexParameters().Length > 0)
{
    // Property is an indexer
}
```
```