コード例 #1
0
        private void AddCalibrationProperty(NodeView nodeView)
        {
            AddEditCalibrationPropertyDialog dialog = new AddEditCalibrationPropertyDialog();
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    NodeView parentNode = nodeView;
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        NodeView child = new NodeView(parentNode)
                                             {
                                                 Id = dialog.CalibrationProperty.Id,
                                                 Name = dialog.CalibrationProperty.Name,
                                                 Description = dialog.CalibrationProperty.Description,
                                                 Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                                                 Type = NodeType.CalibrationPropertyNode,
                                                 HasChildren = false,
                                                 SortField = dialog.CalibrationProperty.Name
                                             };
                        if (nodeView.ChildrenLoaded)
                        {
                            parentNode.Children.Add(child);
                            nodeView.Sort();
                        }
                    }
                };
        }
コード例 #2
0
        private void EditCalibrationProperty(NodeView nodeView)
        {
            AddEditCalibrationPropertyDialog dialog = new AddEditCalibrationPropertyDialog(nodeView.Id);
            dialog.Show();

            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        nodeView.Name = dialog.CalibrationProperty.Name;
                        nodeView.Description = dialog.CalibrationProperty.Description;
                        nodeView.SortField = dialog.CalibrationProperty.Name;
                        nodeView.Parent.Sort();
                    }
                };
        }