private void AddControlSystemAlarmProperty(NodeView nodeView)
 {
     var dialog = new AddEditAlarmPropertyDialog();
     dialog.Closed += (s, e) =>
     {
         var parentNode = nodeView;
         if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
         {
             var child = new NodeView(parentNode)
             {
                 Id = dialog.ControlSystemAlarmProperty.Id,
                 Name = dialog.ControlSystemAlarmProperty.Name,
                 Description = dialog.ControlSystemAlarmProperty.Description,
                 Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                 Type = NodeType.ControlSystemAlarmProperty,
                 HasChildren = false,
                 SortField = dialog.ControlSystemAlarmProperty.Name
             };
             if (nodeView.ChildrenLoaded)
             {
                 parentNode.Children.Add(child);
                 nodeView.Sort();
             }
         }
     };
     dialog.Show();
 }
 private void EditAlarmProperty(NodeView nodeView)
 {
     var dialog = new AddEditAlarmPropertyDialog(nodeView.Id);
     dialog.Show();
     dialog.Closed +=
         (s1, e1) =>
         {
             if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
             {
                 nodeView.Name = dialog.ControlSystemAlarmProperty.Name;
                 nodeView.Description = dialog.ControlSystemAlarmProperty.Description;
                 nodeView.SortField = dialog.ControlSystemAlarmProperty.Name;
                 nodeView.Parent.Sort();
             }
         };
 }