1. 准备一个xml文件
xmlmenu
1<Menu>
2 <MenuItem Name="系统管理" AssemblyName="" FormTag="FALSE" AddToolbar="FALSE">
3 <MenuItem Name="权限管理" ShortCut="" Image="" AssemblyName="" FormTag="FALSE" AddToolButton="FALSE">
4 <MenuItem Name="系统权限管理" ShortCut="" Image="password.png" AssemblyName="HustCAD.IntePLM.WinUI.FrmSysRight,IntePLM.TyRightWinUI" FormTag="TRUE" AddToolButton="FALSE"/>
5 <MenuItem Name="权限规则定义" ShortCut="" Image="right.png" AssemblyName="HustCAD.IntePLM.WinUI.FrmRightRule,IntePLM.TyRightWinUI" FormTag="TRUE" AddToolButton="FALSE"/>
6 <MenuItem Name="权限日志" ShortCut="" Image="doc_yellow_edit.png" AssemblyName="HustCAD.IntePLM.WinUI.FrmRightLog,IntePLM.TyRightWinUI" FormTag="TRUE" AddToolButton="FALSE"/>
7 </MenuItem>
8</Menu>
2.准备一个xml schemal文件来验证xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 sp2 U (http://www.altova.com) by peter (hust) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Menu">
<xs:complexType>
<xs:sequence>
<xs:element ref="MenuItem" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MenuItem">
<xs:complexType>
<xs:sequence>
<xs:element ref="MenuItem" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="AddToolButton">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="TRUE"/>
<xs:enumeration value="FALSE"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="AddToolbar">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="TRUE"/>
<xs:enumeration value="FALSE"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="AssemblyName" type="xs:string" use="required"/>
<xs:attribute name="FormTag" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="TRUE"/>
<xs:enumeration value="FALSE"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Image" type="xs:string"/>
<xs:attribute name="Name" type="xs:string" use="required"/>
<xs:attribute name="ShortCut" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="F1"/>
<xs:enumeration value="F2"/>
<xs:enumeration value="F3"/>
<xs:enumeration value="F4"/>
<xs:enumeration value="F5"/>
<xs:enumeration value="F6"/>
<xs:enumeration value="F7"/>