/// <summary> /// 初始化树数据 /// </summary> public void LoadTreeData() { this.BeginUpdate(); ///只有右侧树才会加载_dicNodeIndexs if (TreeMode == TreeMode.General) { _dicNodeIndexs.Clear(); } SdsiteXmlDocument sdsiteDoc = Service.Sdsite.CurrentDocument; ///添加TreeView的根节点:SiteManagerNode if (this.TreeMode == TreeMode.General) { SiteManagerNode = new SiteManagerNode(Path.GetDirectoryName(SdsiteFilePath)); AddRootNodeToTree(SiteManagerNode); SiteManagerNode.LoadData(); SiteManagerNode.Expand(); this.ContextMenuStrip = TreeContextMenuStrip.CreateForTreeView(this); } else { SelectTreeRootChanNode = new RootChannelNode(Service.Sdsite.CurrentDocument.RootChannel); this.Nodes.Clear(); this.Nodes.Add(SelectTreeRootChanNode); SelectTreeRootChanNode.LoadData(); } this.EndUpdate(); }
protected override void LoadChildNodes() { if (TreeView.TreeMode == TreeMode.General) { FavoriteRootNode = new FavoriteRootNode(); this.AddChildNode(FavoriteRootNode); FavoriteRootNode.LoadData(); } RootChannelNode = new RootChannelNode(Service.Sdsite.CurrentDocument.RootChannel); this.AddChildNode(RootChannelNode); RootChannelNode.LoadData(); }