c# - How to sort a list by a specific property in .NET 2.0? -


this question has answer here:

in .net 4.0 can use linq sort list specific property:

  list<point> list = ...;       sorted = list.orderby(p => p.x).tolist(); // sort list of points x 

can similar when cannot use .net 4.0 linq syntax?

is there one-liner sort syntax?

check sort method, takes comparison<t>. avaliable .net 2.0

var list = new list<point>{ /* populate list */ };  list.sort(comparison);   public int comparison (point a, point b) {     //do logic comparison , b     return -1; } 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -