代码拉取完成,页面将自动刷新
Imports System.IO
Imports System.Threading
Public Class 模仿类
Public 模仿集 As New Dictionary(Of String, List(Of HarryNode))
Public 加载完成 As Boolean
Private 加载路径 As String
Public Sub New(path As String)
加载路径 = path
Dim t As New Thread(AddressOf Load)
t.Start()
End Sub
Private Sub Load()
If Not Directory.Exists(加载路径) Then
Return
End If
Dim directories = Directory.GetDirectories(加载路径)
For Each d In directories
Dim files = Directory.GetFiles(d)
Dim setName As String = IO.Path.GetFileName(d)
模仿集.Add(setName, New List(Of HarryNode))
For Each f In files
If IO.Path.GetExtension(f) = ".json" Then
模仿集(setName).Add(New HarryNode("root", File.ReadAllText(f)))
End If
Next
Next
End Sub
Public Function GetSets() As List(Of String)
Return 模仿集.Keys.ToList
End Function
Public Function GetPath(setName As String, rootPath As String) As Dictionary(Of String, HarryNode)
Dim result As New Dictionary(Of String, HarryNode)
If Not 模仿集.ContainsKey(setName) Then
Return result
End If
For Each node As HarryNode In 模仿集(setName)
If node.GetAtt(rootPath) IsNot Nothing Then
Dim childNode As HarryNode = node.GetNode(rootPath)
For Each childPath In childNode.GetChildPath
If result.ContainsKey(childPath) Then
result(childPath).Merge(childNode.GetNode(childPath))
Else
result.Add(childPath, childNode.GetNode(childPath))
End If
Next
End If
Next
Return result
End Function
End Class
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。