In my scenario,i have the following objects
<playlist> <program id="s63e" start="2011-8-24 16:00:00" end="2011-8-24 17:00:00" priority="2" /> <program id="sv6w" start="2011-8-24 19:00:00" end="2011-8-24 21:00:00" priority="2" /> <program id="3b9a" start="2011-8-26 11:00:00" end="2011-8-26 13:00:00" priority="0" /> </playlist>
I wanna sort them by both time and priority.But my mind was totally twisted.
As u can see, a program object have its own timezone,and a priority.
program usually executes when their start time reached ,and end their execution when its end time reached.
But only one program is allowed to execute at one timezone,let's say, when higher priority program is executing,the lower one can't be launched.
A lower priority value has a higher priority.
The sorting result should return the value whose type is Dictionary<DateTime,string> ,the dictionary simply stores which time executes which program, Any thinking way or sorting algorithm is appreciated.