| 1 |
Public Class clsSynonym |
| 2 |
Inherits clsItem |
| 3 |
Friend Overrides ReadOnly Property AllDescriptions As System.Collections.Generic.List(Of SharedModule.Description) |
| 4 |
Get |
| 5 |
Dim all As New Generic.List(Of Description) |
| 6 |
Return all |
| 7 |
End Get |
| 8 |
End Property |
| 9 |
|
| 10 |
Public Overrides ReadOnly Property Clone As clsItem |
| 11 |
Get |
| 12 |
Return CType(Me.MemberwiseClone, clsSynonym) |
| 13 |
End Get |
| 14 |
End Property |
| 15 |
|
| 16 |
Public Overrides ReadOnly Property CommonName As String |
| 17 |
Get |
| 18 |
Dim sName As String = "" |
| 19 |
For Each sFrom As String In ChangeFrom |
| 20 |
If sName <> "" Then sName &= ", " |
| 21 |
sName &= sFrom |
| 22 |
Next |
| 23 |
sName &= " -> " & ChangeTo |
| 24 |
Return sName |
| 25 |
End Get |
| 26 |
End Property |
| 27 |
|
| 28 |
Public Overrides Function DeleteKey(sKey As String) As Boolean |
| 29 |
|
| 30 |
For Each d As Description In AllDescriptions |
| 31 |
If Not d.DeleteKey(sKey) Then Return False |
| 32 |
Next |
| 33 |
Return True |
| 34 |
|
| 35 |
End Function |
| 36 |
|
| 37 |
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 |
| 38 |
Dim iCount As Integer = iReplacements |
| 39 |
For Each sFrom As String In ChangeFrom |
| 40 |
iReplacements += MyBase.FindStringInStringProperty(sFrom, sSearchString, sReplace, bFindAll) |
| 41 |
Next |
| 42 |
iReplacements += MyBase.FindStringInStringProperty(sTo, sSearchString, sReplace, bFindAll) |
| 43 |
Return iReplacements - iCount |
| 44 |
End Function |
| 45 |
|
| 46 |
Public Overrides Function ReferencesKey(sKey As String) As Integer |
| 47 |
Dim iCount As Integer = 0 |
| 48 |
For Each d As Description In AllDescriptions |
| 49 |
iCount += d.ReferencesKey(sKey) |
| 50 |
Next |
| 51 |
|
| 52 |
Return iCount |
| 53 |
End Function |
| 54 |
|
| 55 |
Private arlFrom As New StringArrayList |
| 56 |
Friend Property ChangeFrom As StringArrayList |
| 57 |
Get |
| 58 |
Return arlFrom |
| 59 |
End Get |
| 60 |
Set(value As StringArrayList) |
| 61 |
arlFrom = value |
| 62 |
End Set |
| 63 |
End Property |
| 64 |
|
| 65 |
Private sTo As String |
| 66 |
Public Property ChangeTo As String |
| 67 |
Get |
| 68 |
Return sTo |
| 69 |
End Get |
| 70 |
Set(value As String) |
| 71 |
sTo = value |
| 72 |
End Set |
| 73 |
End Property |
| 74 |
|
| 75 |
End Class |