标签:
‘类型定义 Public Structure RingRecord Dim recordTime As DateTime Dim footSteps As String Dim sportMinutes As String Dim distance As String Dim calorie As String End Structure ’写比较子 Private Shared Function sortRingRecord(ByVal xRingRecord As RingRecord, ByVal yRingRecord As RingRecord) As Integer If (xRingRecord.recordTime > yRingRecord.recordTime) Then Return -1 ElseIf xRingRecord.recordTime = yRingRecord.recordTime Then Return 0 Else Return 1 End If End Function ‘排序 Dim lstRingRecord As List(Of RingRecord) lstRingRecord = JsonConvert.DeserializeObject(Of List(Of RingRecord))(strRecordData) ‘此处list的元素由Json取得,实际使用依实际情况而定 lstRingRecord.Sort(AddressOf sortRingRecord)
标签:
原文地址:http://www.cnblogs.com/brucechang/p/5503943.html