// Sort friends by rating (0 - 3) onlineFriends.Sort(delegate(Friend f1, Friend f2) { return f2.Rating.CompareTo(f1.Rating); }); // If f1.Rating is 0 and f2.Rating is 0, they may swap places anyway
friends.Sort(delegate(Friend f1, Friend f2) { return f2.Rating.CompareTo(f1.Rating) >= 0 ? 1 : -1; });
friends.Sort(delegate(Friend f1, Friend f2) { int i = f2.Rating.CompareTo(f1.Rating); return i == 0 ? f1.FriendName.CompareTo(f2.FriendName) : i; });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)