Private _Name As Dictionary(Of String, List(Of String))
Friend ReadOnly Property NewProperty() As Dictionary(Of String, List(Of String))
Get
If _Name Is Nothing Then
_Name = GetName()
End If
Return _Name
End Get
End Property
''' <summary>
'''
''' </summary>
''' <returns></returns>
''' <remarks></remarks>
Private Function GetName() As Dictionary(Of String, List(Of String))
Dim codeList As New List(Of String)
Dim dicName As New Dictionary(Of String, List(Of String))
For Each rootCode8 As String In codeList
If rootCode8.Length <> 8 Then
Continue For
End If
If Not dicName.ContainsKey(rootCode8) Then
Dim rootCode4 As String = rootCode8.Substring(4, 4)
Dim list As List(Of String) = GetNameList(rootCode4)
If Not list Is Nothing AndAlso list.Count <> 0 Then
dicName.Add(rootCode8, list)
End If
End If
Next
Return dicName
End Function
''' <summary>
'''
''' </summary>
''' <param name="rootCode4"></param>
''' <returns></returns>
''' <remarks></remarks>
Private Function GetNameList(rootCode4 As String) As List(Of String)
If String.IsNullOrEmpty(rootCode4) Then Return Nothing
Dim list As New List(Of String)
Dim currentNumber As Integer = 1
While True
Dim entry As String = "Name_" & rootCode4 & "_" & currentNumber.ToString
Dim value As String = GetDummyData(entry, "")
value = value.Trim()
'次の値があるか
If Not String.IsNullOrEmpty(value) Then
'次の値があればリストに追加
list.Add(value)
Else
'次の値がないとき
Return list
End If
currentNumber += 1
End While
Return Nothing
End Function
最終更新:2013年11月21日 23:52