Debian Codegraph @

terps/frankendrift/FrankenDrift.Adrift/clsALR.vb

raw
1 Public Class clsALR
2 Inherits clsItem
3
4 Private sOldText As String
5 Private oNewText As Description
6
7 Public Sub New()
8 NewText = New Description
9 End Sub
10 Friend Property OldText() As String
11 Get
12 Return sOldText
13 End Get
14 Set(ByVal Value As String)
15 sOldText = Value
16 End Set
17 End Property
18
19 Friend Property NewText() As Description
20 Get
21 If oNewText Is Nothing Then oNewText = New Description
22 Return oNewText
23 End Get
24 Set(ByVal Value As Description)
25 oNewText = Value
26 End Set
27 End Property
28
29 Public Overrides ReadOnly Property Clone() As clsItem
30 Get
31 Return CType(Me.MemberwiseClone, clsALR)
32 End Get
33 End Property
34
35 Public Overrides ReadOnly Property CommonName() As String
36 Get
37 Return OldText
38 End Get
39 End Property
40
41 Friend Overrides ReadOnly Property AllDescriptions() As Generic.List(Of SharedModule.Description)
42 Get
43 Dim all As New Generic.List(Of Description)
44 all.Add(NewText)
45 Return all
46 End Get
47 End Property
48
49 Friend Overrides Function FindStringLocal(sSearchString As String, Optional sReplace As String = Nothing, Optional bFindAll As Boolean = True, Optional ByRef iReplacements As Integer = 0) As Object
50 Dim iCount As Integer = iReplacements
51 iReplacements += MyBase.FindStringInStringProperty(Me.sOldText, sSearchString, sReplace, bFindAll)
52 Return iReplacements - iCount
53 End Function
54
55 Public Overrides Function ReferencesKey(ByVal sKey As String) As Integer
56 Dim iCount As Integer = 0
57 For Each d As Description In AllDescriptions
58 iCount += d.ReferencesKey(sKey)
59 Next
60
61 Return iCount
62 End Function
63
64
65 Public Overrides Function DeleteKey(ByVal sKey As String) As Boolean
66 For Each d As Description In AllDescriptions
67 If Not d.DeleteKey(sKey) Then Return False
68 Next
69
70 Return True
71 End Function
72
73 End Class