I am working in c#.NEt 2.0. I have a class, let's say X with many properties. Each properties has a custom attribute, an interger, which I planned to use to specify its order int he final array.
Using reflection I read through all of the properties and group the values and place them into a generic list of properties. This works and I can grab the values. But the plan was SORT the list, based on the custom attribute placed on each property, and finally read out the propery values, already ordered, into a string.
Lets say you had the following attribute definition
You could use the following code to pull out the properties on a type in sorted order. Assuming of course they all have this attribute
LINQ Style Solution