public HTXMLNode(XElement element) { this.element = element; this.children = new Dictionary <string, HTXMLNode>(); if (this.GetColor() != Colors.Black) { this.exCount += 1; } if (!IsLeaf()) { foreach (var e in element.Elements("entry")) { HTXMLNode child = new HTXMLNode(e); this.exCount += child.GetExtensionCount(); AddChild(child); //Debug.WriteLine("entry:" + e.Attribute("name").Value); } } Debug.WriteLine("entry:" + this.element.Attribute("name").Value + "exCount:" + this.GetExtensionCount()); }
public HTXMLNode(XElement element) { this.element = element; this.children = new Dictionary<string, HTXMLNode>(); if (this.GetColor() != Colors.Black) { this.exCount += 1; } if (!IsLeaf()) { foreach (var e in element.Elements("entry")) { HTXMLNode child = new HTXMLNode(e); this.exCount += child.GetExtensionCount(); AddChild(child); //Debug.WriteLine("entry:" + e.Attribute("name").Value); } } Debug.WriteLine("entry:" + this.element.Attribute("name").Value + "exCount:" + this.GetExtensionCount()); }
public MainPage() { InitializeComponent(); XDocument xdoc = XDocument.Load("resources/result.xml"); root = new HTXMLNode(xdoc.Element("xbrldata")); hypertree = new HyperTree(root); //TODO:是否使用静态方法? Graphic graphic = new Graphic(); //graphic.Canvas = this.LayoutRoot; SilverlightHTView view = hypertree.GetSLView(); graphic.Canvas = view.LayoutRoot; view.graphic = graphic; view.Repaint(); this.Width = 500; this.Height = 500; this.LayoutRoot.Children.Add(view); }
private void AddChild(HTXMLNode child) { this.children.Add(child.GetName(), child); }