I have 2 different sort function in my Root class
Notice how I do "Implements System.Collections.IComparer.Compare" on the 2nd compare. On top of the root class I state
But I can only use
once in a class. And each function that has to sort needs to implement it or whatever. How do I solve this ?
Many thx, N3XuS
Code:
#Region "Functie: Sorteren Leden"
Public Function SorterenLeden(ByVal oLid1 As Object, ByVal oLid2 As Object) As Integer
Dim oObject1 As Project.Classes.clsLeden = CType(oLid1, Project.Classes.clsLeden)
Dim oObject2 As Project.Classes.clsLeden = CType(oLid2, Project.Classes.clsLeden)
Return oLid1.positie.CompareTo(oObject2.positie)
End Function
#End Region
#Region "Functie: Sorteren Evenementen"
Public Function SorterenEvenementen(ByVal oEvenement1 As Object, ByVal oEvenement2 As Object) As Integer Implements System.Collections.IComparer.Compare
Dim oObject1 As Project.Classes.clsKalender = CType(oEvenement1, Project.Classes.clsKalender)
Dim oObject2 As Project.Classes.clsKalender = CType(oEvenement2, Project.Classes.clsKalender)
Return oEvenement1.Datum.CompareTo(oObject2.Datum)
End Function
#End Region
Notice how I do "Implements System.Collections.IComparer.Compare" on the 2nd compare. On top of the root class I state
Code:
Public Class clsRoot
Implements Project.Classes.intInterface
Implements System.Collections.IComparer
Code:
Implements System.Collections.IComparer.Compare
Many thx, N3XuS