Sort List <Rectangle>
<p>How do I sort a rectangle list by their area? Been looking into IComparable at msdn library, but can't figure it out... I wrote this:</p>

<pre><code>SortedL= new List&lt;Rectangle&gt;();
        int count1 = 0;
        int count3 = redovi;
        while (count1 &lt; count3)
        {
            int count2 = 0;
            while (count2 &lt; count3)
            {
                int x = Oblici[count1].Width;
                int y = Oblici[count1].Height;
                int z = Oblici[count2].Width;
                int w = Oblici[count2].Height;
                int area1 = x * y;
                int area2 = z * w;
                int a = area1.CompareTo(area2);
                if (a &lt; 0)
                {
                    count1 = count2;
                    if (count2 &lt; (count3 - 1))
                    {
                        count2++;
                    }
                    else break;
                }
                else if (a == 0)
                {
                    if (count2 &lt; (count3 - 1))
                    {
                        count2++;
                    }
                    else break;
                }
                else if (a &gt; 0)
                {
                    if (count2 &lt; count3 - 1)
                    {
                        count2++;
                    }
                    else break;
                }
            }
            SortedL.Add(Oblici[count1]);
            Oblici.RemoveAt(count1);
            count3 = (count3 - 1);}}
</code></pre>

<p>And it works, but it's pretty ugly, and I know there is an easier way...</p>
