RibbonControl 转 XML树
发布时间:2020-12-16 08:26:16 所属栏目:百科 来源:网络整理
导读:string attrName="Name';string PagesNode="Pages";string RibbonNode="Ribbon";string GroupsNode="Groups";string ItemNode="Items";XmlDocument doc=new XmlDocument();XmlDeclaration dec=doc.CreateXmlDeclaration("1.0","GB2312",null);doc.AppendChil
string attrName="Name'; string PagesNode="Pages"; string RibbonNode="Ribbon"; string GroupsNode="Groups"; string ItemNode="Items"; XmlDocument doc=new XmlDocument(); XmlDeclaration dec=doc.CreateXmlDeclaration("1.0","GB2312",null); doc.AppendChild(dec); XmlElement Robbon=doc.CreateElement(RibbonNode); doc.AppendChild(Robbon); for(int i=0;i<fRorm.Pages.Count;i++) { XmlElement Pages=doc.CreateElement(PagesNode); Pages.SetAttribute(attrName,fRorm.Pages[i].Name); for(int k=0;k<fRorm.Pages[i].Groups.Count;i++) { XmlElement Groups=doc.CreateElement(PagesNode); Groups.SetAttribute(attrName,fRorm.Pages[i].GroupsName); for(int b=0;b<fRorm.Pages[i].Groups[i].ItemLinks.Count;b++) { string itermName=ItemsLink[b].iIem.Name; XmlElement iItem=doc.CreateElement(PagesNode); iItem.SetAttribute(attrName,itermName); Groups.AppendChild(item); } Pages.AppenChild(Groups); } Ribbon.AappendChild(Pages); } doc.Save(); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |