3
我正在尝试使用TreeView控件将XML文件加载到我的GUI中。 但是,我为我的XML文件使用专有布局。将XML文件读入TreeView
的XML的结构是这样的:
<ConfiguratorConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Section>
<Class ID="Example" Name="CompanyName.Example" Assembly="Example.dll">
<Interface>
<Property Name="exampleProperty1" Value="exampleValue" />
<Property Name="exampleProperty2" Value="exampleValue" />
<Property Name="exampleProperty3" Value="exampleValue" />
</Interface>
</Class>
</Section>
</ConfiguratorConfig>
我想输出将结构类似:
Class "Example"
Property "exampleProperty1"
Property "exampleProperty2"
Property "exampleProperty3"
我全新的使用XML。过去几个小时我一直在网上搜索,结果都没有帮助。有些已经接近,但可能属性不会显示,或节点的名称将不会显示,等等。
我在C#中编写Visual Studio 2005. 感谢您的帮助!
完美!我设法调整这个代码来填充我的TreeView,而这正是我所需要的。 – Fraserr 2012-07-09 14:38:33
太棒了!我很高兴帮助:) – 2012-07-09 16:31:33