private void EditAlarmConsequence(NodeView nodeView) { var dialog = new AddEditAlarmConsequenceDialog(nodeView.Id); dialog.Show(); dialog.Closed += (s1, e1) => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { nodeView.Name = dialog.AlarmConsequence.Name; nodeView.Description = dialog.AlarmConsequence.Description; nodeView.SortField = dialog.AlarmConsequence.Ordinal.ToString(); nodeView.Parent.Sort(); } }; }
private void AddAlarmConsequence(NodeView nodeView) { var dialog = new AddEditAlarmConsequenceDialog(); dialog.Show(); dialog.Closed += (s1, e1) => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { var child = new NodeView(nodeView) { Id = dialog.AlarmConsequence.Id, Name = dialog.AlarmConsequence.Name, Description = dialog.AlarmConsequence.Description, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png", Type = NodeType.AlarmConsequenceNode, HasChildren = false, SortField = dialog.AlarmConsequence.Name }; if (nodeView.ChildrenLoaded) { nodeView.Children.Add(child); nodeView.Sort(); } } }; }