private void AddNodes(TreeNodeCollection nodes, OptionsBase options) { foreach (OptionsBase options1 in (IEnumerable <OptionsBase>)options.SubOptions) { OptionsNode optionsNode = new OptionsNode(options1); nodes.Add((TreeNode)optionsNode); if (!this.optionsNodes.ContainsKey(options1.GetType())) { this.optionsNodes.Add(options1.GetType(), optionsNode); } this.AddNodes(optionsNode.Nodes, options1); } if (nodes.Count <= 0 || options is AppOptions) { return; } GeneralOptionsNode generalOptionsNode = new GeneralOptionsNode(options); nodes.Insert(0, (TreeNode)generalOptionsNode); }
private void AddNodes(TreeNodeCollection nodes, OptionsBase options) { foreach (OptionsBase options1 in (IEnumerable<OptionsBase>) options.SubOptions) { OptionsNode optionsNode = new OptionsNode(options1); nodes.Add((TreeNode) optionsNode); if (!this.optionsNodes.ContainsKey(options1.GetType())) this.optionsNodes.Add(options1.GetType(), optionsNode); this.AddNodes(optionsNode.Nodes, options1); } if (nodes.Count <= 0 || options is AppOptions) return; GeneralOptionsNode generalOptionsNode = new GeneralOptionsNode(options); nodes.Insert(0, (TreeNode) generalOptionsNode); }