/// <summary> /// 获取物理图 /// </summary> /// <param name="node">节点</param> public PhysicalDiagramInfo GetPhysicalDiagram(XmlNode node) { var physicalDiagram = new PhysicalDiagramInfo(); var xe = (XmlElement)node; physicalDiagram.PhysicalDiagramId = xe.GetAttribute(Const.Id); foreach (XmlNode property in xe.ChildNodes) { property.CommonInfoHandle(physicalDiagram); switch (property.Name) { case Const.ADisplayPreferences: //physicalDiagram.DisplayPreferences = property.InnerText; break; case Const.APaperSize: physicalDiagram.PagerSize = property.InnerText; break; case Const.APageMargins: physicalDiagram.PageMargins = property.InnerText; break; case Const.APageOrientation: physicalDiagram.PageOrientation = property.InnerText.ToInt(); break; case Const.APaperSource: physicalDiagram.PaperSource = property.InnerText.ToInt(); break; } } return(physicalDiagram); }
/// <summary> /// 绑定TreeView数据源 /// </summary> private void Data_Bind(List <PhysicalDiagramInfo> list) { treeView1.CheckBoxes = true; PhysicalDiagramInfo pd = list[0]; TreeNode node = new TreeNode(); node.Text = pd.Name; node.Name = pd.Id; node.Tag = pd.IfEnd; node.Checked = false; treeView1.Nodes.Add(node); AddReplies(list, node); node.Expand(); }