List<MyObject> myList = new List<MyObject>();
foreach(SomeObject obj in someObjects)
{
MyObject mo = new MyObject();
mo.SomeInteger = obj.OriginalInteger;
mo.OtherRandomData = obj.OtherRandomData;
myList.Add(obj);
}
myList.Sort(/* NOT SURE WHAT TO WRITE HERE */);
因此,MyList中的MyObjects最終被SomeInteger排序得最少。什麼我通過列表<Object> .Sort()通過Object.SomeInteger最小到最大的項目排序?
好嗎?我認爲這是相當不錯的;-) – Steven 2011-01-26 20:31:24