List sorting on nested struct members
<p>I have a little problem with sorting out a list using an implementation of IComparer. </p>

<pre><code>public struct VAL
{
    public int i;
    public string s;
}

public struct INFO
{
    public string name;
    public VAL val;
    public string address;
}

public class ListSorter:IComparer&lt;INFO&gt;
{
    public enum SORT_TYPE{BYNAME, BYVAL,BYADDRESS};
    public int Compare(INFO i1, INFO i2)
        {
        switch(sortType)
        {
            case SORT_TYPE.BYNAME;
                return string.Compare(i1.name, i2.name);
            case SORT_TYPE.BYADDRESS:
                return string.Compare(i1.address, i2.address); 
            case SORT_TYPE.BYVAL:
            {
                ??????
            }
        }
    }   
}
</code></pre>

<p>The comparison function in the class ListSorter is an example of how I am comparing strings in the given INFO struct. But I don't know how to sort the list based on the VAL struct information members</p>
