/// <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 CreateNewSubnet(object sender, EventArgs e) { FormEditSubnet formNewSubnet = new FormEditSubnet(this.treeViewObject.SelectedNode, ModeForm.New); formNewSubnet.ShowDialog(); this.treeViewObject.Sort(); if (formNewSubnet.TreeNode != null) { // Выделяем только что созданную сеть в дереве справочника this.treeViewObject.SelectedNode = formNewSubnet.TreeNode; } }