Windows Mobile TreeView从xml文件中加载数据
2010-10-09 09:59:00 来源:本站整理< /option>
< /group>
< /group>
< /options>
大约有这个XML一些规则。
Each node type has a name and a displayName attributes. name , which is required, is used or referenced in our program. displayName , which is optional, is used in the TreeView for presentation.每个节点类型都有一个name和一个displayName属性。 name ,这是必需的,是用来或程序中引用的。 displayName ,这是可选的,是树视图中使用的演示文稿。 If a displayName is missing, the corresponding name is used for presentation.如果displayName丢失,相应的name是用于演示。
group can contain zero or more option nodes and group nodes (or subgroups). group可以包含零个或多个option节点和group节点(或小组)。 We can have as many levels of embedded group nodes as we want.我们可以有许多层次的嵌入式group节点,我们想要的。
option must only contain one or more value nodes. option必须只包含一个或多个value的节点。
Only one of the multiple value nodes of an option can have a selected attribute of "true", indicating that it is the current value of the option .只有多个之一value一节点的option可以有一个selected “属性”真,这表明它是当前value的option 。
From programming point of view, using such an XML as data store for our Options component has these advantages:从编程的角度来看作为我们的选择组件的数据存储一个XML等,具有以下优点:
Both XML and TreeView are based on tree structure. XML和TreeView的是基于树结构。 One for storage and one for presentation.一个用于存储和表现之一。 This perfect match makes programming easy.这个完美的配合使得编程容易。
Organizing options in groups and subgroups is inherently supported.在选项组和子组组织本质上是支持的。
It makes it easy to manage both the selected values and all the available values.它可以轻松地同时管理的价值观和选择所有可用的值。 With the traditional Settings file, only selected values are persisted, whileas the available values are either in a
更多精彩
赞助商链接