Bonjour
J'ai crée une class Test
elle contient la propriété id
j'ai Implémente l'Icomparable
Implements IComparable(Of Test)
et la fonction de comparaison
1 2 3 4 5 6 7 8 9
| Public Function CompareTo(ByVal other As Test) As Integer _
Implements System.IComparable(Of Test).CompareTo
' Compare this ones name with the other ones name.
' return <0 if this one comes first,
' 0 if they are equal,
' >0 if the other one comes first.
' String.Compare does this anyway
Return String.Compare(Me.Id, other.Id)
End Function |
J'ai maintenant une variable de type arraylist, qui contient une liste de Test
Je veux savoir comment faire l'appel de la méthode de tri, pour trier suivant la propriété id?
Merci
Partager