H
henry.lee.jr
Looking for a best approach to the following situation:
I want to create an array of objects that have an ID property and a
Priority property. The trick is that I want to leverage the power of a
Dictionary type object so that I can reference the items by their ID,
like so:
string n = MyObject("2468").Name
int p = MyObject("2468").Priority
At the same time, I also need to loop through these items in an order
that is by Priority.
I would love to simply use a foreach loop, but I believe in the past
when I have done this with a Dictionary object, the order of the
foreach loop is determined by the compiler, and not the order items
were added using .Add()
This is probably a fairly simple question, so thanks in advance!
I want to create an array of objects that have an ID property and a
Priority property. The trick is that I want to leverage the power of a
Dictionary type object so that I can reference the items by their ID,
like so:
string n = MyObject("2468").Name
int p = MyObject("2468").Priority
At the same time, I also need to loop through these items in an order
that is by Priority.
I would love to simply use a foreach loop, but I believe in the past
when I have done this with a Dictionary object, the order of the
foreach loop is determined by the compiler, and not the order items
were added using .Add()
This is probably a fairly simple question, so thanks in advance!