/// <summary> /// Метод вывода форм редактирования объектов справочника /// </summary> /// <param name="tn">Редактируемый узел</param> private void EditLCTreeNode(LCTreeNode tn) { if (tn != null) { switch (tn.LCObjectType) { case LCObjectType.Host: { //FormEditHost formEditComputer = new FormEditHost(this.treeViewObject.SelectedNode); FormEditHost formEditComputer = new FormEditHost(tn); formEditComputer.ShowDialog(); break; } case LCObjectType.Group: { //FormEditGroup formEditGroup = new FormEditGroup(this.treeViewObject.SelectedNode, ModeForm.Edit); FormEditGroup formEditGroup = new FormEditGroup(tn, ModeForm.Edit); formEditGroup.ShowDialog(); break; } case LCObjectType.SubNet: { //FormEditSubnet formEditSubnet = new FormEditSubnet(this.treeViewObject.SelectedNode, ModeForm.Edit); FormEditSubnet formEditSubnet = new FormEditSubnet(tn, ModeForm.Edit); formEditSubnet.ShowDialog(); break; } } } }
/// <summary> /// Событие создания новой группы /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CreateNewGroup(object sender, EventArgs e) { FormEditGroup formNewGroup = new FormEditGroup(this.treeViewObject.SelectedNode, ModeForm.New); formNewGroup.ShowDialog(); this.treeViewObject.Sort(); if (formNewGroup.TreeNode != null) { // Выделяем только что созданную группу в дереве справочника this.treeViewObject.SelectedNode = formNewGroup.TreeNode; } }