private void AddNewPromptGroup(NodeView nodeView) { AddEditPromptGroupDialog dialog = new AddEditPromptGroupDialog(); dialog.Title = "Add new Prompt Group"; dialog.Show(); dialog.Closed += (s1, e1) => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { NodeView child = new NodeView(nodeView) { Id = dialog.SavedPromptGroup.Id, Name = dialog.SavedPromptGroup.Name.ToString(), Description = dialog.SavedPromptGroup.Description, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png", Type = NodeType.PromptGroup, HasChildren = true, SortField = dialog.SavedPromptGroup.Ordinal.ToString(), //IsActive = dialog.SavedPrompt.IsActive }; if (nodeView.ChildrenLoaded) { nodeView.Children.Add(child); nodeView.Sort(); } } nodeView.Sort(false); }; }
private void EditPromptGroup(NodeView nodeView) { AddEditPromptGroupDialog dialog = new AddEditPromptGroupDialog(nodeView.Id); dialog.Title = "Edit Prompt Group"; dialog.Show(); dialog.Closed += (s1, e1) => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { nodeView.Name = dialog.SavedPromptGroup.Name.ToString(); nodeView.Description = dialog.SavedPromptGroup.Description; nodeView.SortField = dialog.SavedPromptGroup.Ordinal.ToString(); } nodeView.Parent.Sort(false); }; }