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 });
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"n3llyb0y" <n3******@aol.comwrote in message
news:2007052217020350073-n3llyb0y@aolcom...
On 2007-05-22 16:53:21 +0100, "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard.caspershouse.comsaid:
>Neil,
Are you using this for another applet you are going to use in
powershell, or as part of your program? If you are going to use it as
part of your program, you are better off using the sorting functionality
that is provided to you by the framework.
It's for a program. I am trying to learn C#, in part by converting some
powershell scripts I have. I couldn't find any reference to sorting within
the framework so thought I'd have to write my own algorithm or use the
powershell assembly.
If you can point me to some documentation that would be great!
Cheers,
n