private void ChangeParent(SmartQuant.Portfolio portfolio) { if (!this.nodes.ContainsKey(portfolio.Name)) { return; } PortfolioNode portfolioNode = this.nodes[portfolio.Name]; portfolioNode.Remove(); this.nodes[portfolio.Parent.Name].Nodes.Add((TreeNode)portfolioNode); }
private void AddPortfolio(SmartQuant.Portfolio portfolio) { if (this.nodes.ContainsKey(portfolio.Name)) { return; } PortfolioNode portfolioNode = new PortfolioNode(portfolio.Name); this.nodes[portfolio.Name] = portfolioNode; if (portfolio.Parent == null) { this.trvPortfolios.Nodes.Add((TreeNode)portfolioNode); } else { this.nodes[portfolio.Parent.Name].Nodes.Add((TreeNode)portfolioNode); } }
private void AddPortfolio(SmartQuant.Portfolio portfolio) { if (this.nodes.ContainsKey(portfolio.Name)) return; PortfolioNode portfolioNode = new PortfolioNode(portfolio.Name); this.nodes[portfolio.Name] = portfolioNode; if (portfolio.Parent == null) this.trvPortfolios.Nodes.Add((TreeNode) portfolioNode); else this.nodes[portfolio.Parent.Name].Nodes.Add((TreeNode) portfolioNode); }