VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "SortBridge"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Sortuje dane zanim przekaże je klasom visList

Implements Bridger
Private brdg As Bridger
Private prods() As Product
'----------
Private Sub Bridger_addData(col As Collection)
Dim max As Integer, tprod As Product
max = col.Count
ReDim prods(max) As Product
Dim i As Integer, j As Integer
'Skopiuj do tablicy
For i = 1 To max
  Set prods(i) = col(i)
Next i
'Posortuj tablicę
For i = 1 To max
  For j = i To max
    If prods(i).getName > prods(j).getName Then
      Set tprod = prods(i)
      Set prods(i) = prods(j)
      Set prods(j) = tprod
    End If
  Next j
Next i
'Umieść na powrót w kolekcji
Set col = Nothing
Set col = New Collection
For i = 1 To max
 col.Add prods(i)
Next i
'Przekaż klasie mostu
brdg.addData col
End Sub
'----------
Private Sub Bridger_init(visL As visList)
Set brdg = New ListBridge
brdg.init visL
End Sub
