Determine array size after GetType()
<p>Here is what I have</p>

<pre><code>        int[] x = new int[10];

        Type type = x.GetType();
        if (type.IsArray)
        {
            Type typeOfElement = type.GetElementType();
            int length = 0; // how do I get array's length????
        }
</code></pre>

<p>Is there a way to determine length of array using Type? </p>