Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort paining my brains :(

Status
Not open for further replies.

N3XuS

Programmer
Mar 1, 2002
339
BE
I have 2 different sort function in my Root class

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
But I can only use
Code:
 Implements System.Collections.IComparer.Compare
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top