// creates duplicate list in ascending order
List<WindRosePlotDataRecord> SortedList = _Rows.OrderByDescending(o => o.Parameter).ToList();
// creates duplicate list in descending order
List<WindRosePlotDataRecord> SortedList = _Rows.OrderByDescending(o => o.Parameter).ToList();
// sort-in-place in ascending order
_Rows.Sort((x, y) => x.Parameter.CompareTo(y.Parameter));
// sort-in-place in descending order
_Rows.Sort((x, y) => y.Parameter.CompareTo(x.Parameter)); // we switched x and y in CompareTo
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter