-
Notifications
You must be signed in to change notification settings - Fork 0
/
M_clsLogFilterCollection.def
54 lines (44 loc) · 1.4 KB
/
M_clsLogFilterCollection.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'---------------------------------------------------------------------------------------
' Module : clsLogFilterCollection
' Author : K.Gundermann
' Date : 04.02.2012
' Purpose : Collection of Matchers
' MatchFilter is True as soon as ONE Matcher is True
'---------------------------------------------------------------------------------------
Option Compare Database
Option Explicit
Private colFilterCollection As Collection
Private Sub Class_Initialize()
Set colFilterCollection = New Collection
End Sub
Public Sub AddFilter(ByVal TheFilter As clsLogFilter)
Collection.Add TheFilter
End Sub
Public Property Get Collection() As Collection
Set Collection = colFilterCollection
End Property
Public Property Get Count() As Long
Count = Collection.Count
End Property
Public Function MatchFilter(objLogEntry As clsLogEntry) As Boolean
Dim varFilter As Variant
Dim objFilter As clsLogFilter
If Collection.Count = 0 Then
MatchFilter = True
Else
For Each varFilter In Collection
Set objFilter = varFilter
If objFilter.IsMatch(objLogEntry) Then
MatchFilter = True
Exit Function
End If
Next
End If
End Function
Public Sub Clear()
Call Class_Initialize
End Sub