VB.NET-Quellcode
- ' Implemnentation of the IComparer:Compare
- ' method for comparing two objects.
- Public Function [Compare](ByVal x As Object, ByVal y As Object) As Integer Implements IComparer.Compare
- Dim xItem As SortWrapper = CType(x, SortWrapper)
- Dim yItem As SortWrapper = CType(y, SortWrapper)
- Dim xText As String = xItem.sortItem.SubItems(xItem.sortColumn).Text
- Dim yText As String = yItem.sortItem.SubItems(yItem.sortColumn).Text
- Return xText.CompareTo(yText) * IIf(Me.ascending, 1, -1)
- End Function
- End Class
Zeile:
Return xText.CompareTo(yText) * IIf(Me.ascending, 1, -1)