16,722
社区成员




<?xml version="1.0" encoding="utf-8"?>
<Config>
<Root Level="0" Index="0" Code="A" Name="方案1">
<Solution Level="1" Index="0" Code="A1" Name="默认配置1">
<Bind Level="2" Index="0" Code="A1A" Name="声音1"/>
<Bind Level="2" Index="1" Code="A1B" Name="回音1"/>
</Solution>
<Solution Level="1" Index="1" Code="A2" Name="默认配置2">
<Bind Level="2" Index="0" Code="A2A" Name="声音2"/>
<Bind Level="2" Index="1" Code="A2B" Name="回音2"/>
</Solution>
</Root>
<Root Level="0" Index="1" Code="B" Name="方案2">
<Solution Level="1" Index="0" Code="B1" Name="默认配置1">
<Bind Level="2" Index="0" Code="B1A" Name="声音1"/>
<Bind Level="2" Index="1" Code="B1B" Name="回音1"/>
</Solution>
<Solution Level="1" Index="1" Code="B2" Name="默认配置2">
<Bind Level="2" Index="0" Code="B2A" Name="声音2"/>
<Bind Level="2" Index="1" Code="B2B" Name="回音2"/>
</Solution>
</Root>
</Config>
Public Class XMLMsg
Public Property Level() As String
Public Property Index() As String
Public Property Code() As String
Public Property Name() As String
End Class
Dim tCond As New XMLMsg
tCond.Level = "0"
tCond.Index = "0"
tCond.Code = "A"
tCond.Name = "方案1"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "1"
tCond.Index = "0"
tCond.Code = "A1"
tCond.Name = "1-默认配置1"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "2"
tCond.Index = "0"
tCond.Code = "A1A"
tCond.Name = "1-声音1"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "2"
tCond.Index = "1"
tCond.Code = "A1B"
tCond.Name = "1-回音1"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "1"
tCond.Index = "1"
tCond.Code = "A2"
tCond.Name = "1-默认配置2"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "2"
tCond.Index = "0"
tCond.Code = "A2A"
tCond.Name = "1-声音2"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "2"
tCond.Index = "1"
tCond.Code = "A2B"
tCond.Name = "1-回音2"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "0"
tCond.Index = "1"
tCond.Code = "B"
tCond.Name = "方案2"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "1"
tCond.Index = "0"
tCond.Code = "B1"
tCond.Name = "2-默认配置1"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "2"
tCond.Index = "0"
tCond.Code = "B1A"
tCond.Name = "2-声音1"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "2"
tCond.Index = "1"
tCond.Code = "B1B"
tCond.Name = "2-回音1"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "1"
tCond.Index = "1"
tCond.Code = "B2"
tCond.Name = "2-默认配置2"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "2"
tCond.Index = "0"
tCond.Code = "B2A"
tCond.Name = "2-声音2"
MsgLsit.Add(tCond)
tCond = New XMLMsg
tCond.Level = "2"
tCond.Index = "1"
tCond.Code = "B2B"
tCond.Name = "2-回音2"
MsgLsit.Add(tCond)
ComboBox1.Items.Clear()
Com1.Clear()
Dim Comd1 = From x In MsgLsit Where x.Code = "A" Or x.Code = "B" Select x
For Each t As XMLMsg In Comd1
Com1.Add(t)
ComboBox1.Items.Add(t.Name)
Next
If ComboBox1.Items.Count > 0 Then
ComboBox1.SelectedIndex = 0
End If
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedIndex >= 0 Then
Com2.Clear()
ComboBox2.Items.Clear()
Dim tCond As New XMLMsg
tCond = Com1(ComboBox1.SelectedIndex)
Dim Comd2 = From x In MsgLsit Where x.Level = 1 And x.Code.Substring(0, 1) = tCond.Code Select x
For Each t As XMLMsg In Comd2
Com2.Add(t)
ComboBox2.Items.Add(t.Name)
Next
If ComboBox2.Items.Count > 0 Then
ComboBox2.SelectedIndex = 0
End If
End If
End Sub
Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
If ComboBox2.SelectedIndex >= 0 Then
Com3.Clear()
ComboBox3.Items.Clear()
Dim tCond As New XMLMsg
tCond = Com2(ComboBox2.SelectedIndex)
Dim Comd2 = From x In MsgLsit Where x.Level = 2 Select x
For Each t As XMLMsg In Comd2
If t.Code.Substring(0, 2) = tCond.Code Then
Com3.Add(t)
ComboBox3.Items.Add(t.Name)
End If
Next
If ComboBox3.Items.Count > 0 Then
ComboBox3.SelectedIndex = 0
End If
End If
End Sub