private void BuildUnitFromUnitSettings(TreeNode root, TsUnitSettings unitSettings) { TreeNode node = new TreeNode(unitSettings.Name, 2, 2); node.Tag = unitSettings; root.Nodes.Add(node); }
private void NewTurnstile() { TsUnitSettings unitSettings = new TsUnitSettings(); unitSettings.Name = string.Format("Турникет{0}", tvSettings.SelectedNode.Nodes.Count + 1); AMCSLogicSettings logicSettings = (AMCSLogicSettings)tvSettings.SelectedNode.Tag; logicSettings.Units.Add(unitSettings); TreeNode node = new TreeNode(unitSettings.Name, 2, 2); node.Tag = unitSettings; tvSettings.SelectedNode.Nodes.Add(node); tvSettings.SelectedNode.Expand(); _modified = true; SettingsControlsEnabled(); }