Neil,
In this case, I really wouldn't use a dictionary for storing the values.
Rather, I would have a structure like this (change the names appropriately):
public struct FruitInfo
{
public string Fruit;
public int[,] Values;
}
Then, you would have instances of your structures that you create in an
array.
Once you have all of these, you can call the static Sort method on the
Array class, passing a delegate to the comparison parameter to determine the
sort order:
// The array of FruitInfo instances.
FruitInfo[] fruitInfo = ...;
// Assume you have populated the array of fruitInfo instances.
Array.Sort(fruitInfo, delegate(FruitInfo x, FruitInfo y) { <code to do
comparison here> > });

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
>> Neil,
>>
[quoted text clipped - 12 lines]
> Cheers,
> n
n3llyb0y - 23 May 2007 06:22 GMT
> Neil,
>
[quoted text clipped - 21 lines]
> Array.Sort(fruitInfo, delegate(FruitInfo x, FruitInfo y) { <code to do
> comparison here> > });
Thanks Nicholas :-)
Neil Chambers - 06 Jun 2007 14:16 GMT
> Neil,
>
[quoted text clipped - 21 lines]
> Array.Sort(fruitInfo, delegate(FruitInfo x, FruitInfo y) { <code to do
> comparison here> > });
I'm getting close but I could do with a little more guidance.
Within the comparison code, will I be making use of 'Comparer<myStruct>'?
I can't seem to get a working statement. I need the Comparer to access
an index point within the 'Values' element of the object but I'm
failing. I'm clearly in at the deep end here but a little explanation
of how to get the sort working on the delegates would be much
appreciated.
Cheers,
n