VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "FileChain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Klasa FileChain
Implements Chain
Private lst As ListBox
Private fl As File
Private chn As Chain
Private hasLink As Boolean

Private Sub Chain_addChain(c As Chain)
  Set chn = c
  hasLink = True
End Sub

Private Function Chain_getChain() As Chain
  Set Chain_getChain = chn
End Function

Private Function Chain_hasChain() As Boolean
  Chain_hasChain = hasLink
End Function

Private Sub Chain_sendToChain(mesg As String)
  Dim fls As String
  ChDrive Left(App.Path, 2)
  ChDir App.Path                  'Bieżący katalog
  fls = Dir(mesg & "*.*")
  If Len(fls) > 0 Then
    lst.AddItem fls               'Dodaj do listy
  Else
    If hasLink Then
      chn.sendToChain mesg        'Prześlij do klasy Nocmd
    End If
  End If
End Sub

Private Sub Chain_setControl(c As Control)
  Set lst = c
End Sub

Private Sub Class_Initialize()
  Set fl = New File
End Sub
