List<T>的排序
List<DataPoint> dataPointsDataPints = ...;
//按RegisterAddress升序排序 dataPointsDataPints.Sort(new DataPointRegisterAddressCompare());
排序类:
public class DataPointRegisterAddressCompare : IComparer<DataPoint> { public int Compare(DataPoint x, DataPoint y) { return x.StartRegisterAddress.CompareTo(y.StartRegisterAddress); } }