Exemplo n.º 1
0
        /// <summary>
        /// This event deletes a selected node.
        /// </summary>
        /// <param name="sender">
        /// Name of the object.
        /// </param>
        /// <param name="e">
        /// This class contains no event data; it is used by events that do not pass state information to an event
        /// handler when an event is raised. If the event handler requires state information, the application must
        /// derive a class from this class to hold the data.
        /// </param>
        public void clickMenuRemoveSCL(object sender, EventArgs e)
        {
            WindowTreeViewLNType windowTreeViewLNType;

            OpenSCL.Object sCL = new OpenSCL.Object();
            sCL.Configuration = (SCL)this.treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Tag;
            if (!this.treeSCL.TreeView.SelectedNode.Tag.GetType().Equals(typeof(SCL)))
            {
                switch (this.treeSCL.TreeView.SelectedNode.Tag.GetType().Name)
                {
                case "tDOI[]":
                case "tDOI":
                case "tDAI[]":
                case "tDAI":
                case "tSDI[]":
                case "tSDI":
                case "tVal[]":
                case "tVal":
                    this.treeSCL = this.treeViewSCL.SearchUPForBaseTypeAndGetSCLTreeNode(this.treeSCL.TreeView.SelectedNode, (typeof(tAnyLN)));
                    if (this.treeSCL != null)
                    {
                        windowTreeViewLNType = new WindowTreeViewLNType(this.treeSCL, sCL.Configuration, this.treeSCL.Tag, "Edit");
                        windowTreeViewLNType.ReloadLNType();
                        windowTreeViewLNType.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("It doesn't load the class");
                    }
                    break;

                case "tGSEControl":
                    treeViewSCL.RemoveGSEandSMV(this.treeSCL, this.objectManagement.FindVariable(this.treeSCL.TreeView.SelectedNode.Tag, "name").ToString(), "tGSE");
                    break;

                case "tSampledValueControl":
                    treeViewSCL.RemoveGSEandSMV(this.treeSCL, this.objectManagement.FindVariable(this.treeSCL.TreeView.SelectedNode.Tag, "name").ToString(), "tSMV");
                    break;

                default:
                    if (MessageBox.Show("Warning!, Do you want to remove this node?", "Removing Node", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly, false) == DialogResult.Yes)
                    {
                        AutomataForValidateToTreeNode automataForValidateToTreeNode;
                        RegularExpressionTree         regularExpressionTree = new RegularExpressionTree();
                        automataForValidateToTreeNode = new AutomataForValidateToTreeNode(this.treeSCL.TreeView.SelectedNode, regularExpressionTree.GetRegExpToDelete(this.treeSCL.TreeView.SelectedNode));
                        automataForValidateToTreeNode.InterpretString();
                    }
                    break;
                }
            }
            else
            {
                MessageBox.Show("Warning!, The SCL node can not be removed!!!");
            }
        }
Exemplo n.º 2
0
 public AutomataForValidateToTreeNode(TreeNode node, string keys)
 {
     this.ListErrors            = new List <ErrorsManagement>();
     this.node                  = node;
     this.keys                  = keys;
     this.index                 = 0;
     this.regularExpression     = new RegularExpression();
     this.property              = new ArrayList();
     this.valueProperties       = new ArrayList();
     this.objectManagement      = new ObjectManagement();
     this.objectSCL             = this.node.Tag;
     this.namesPropertiesObject = new ArrayList();
     this.flag                  = true;
     this.flags                 = new List <bool>();
     this.regularExpressionTree = new  RegularExpressionTree();
     this.selectNodeToDelete    = node;
 }
        /// <summary>
        /// This event creates the nodes on the main SCL TreeNode according to the Data selected.
        /// </summary>
        /// <param name="sender">
        /// Name of the object.
        /// </param>
        /// <param name="e">
        /// This class contains no event data; it is used by events that do not pass state information to an event
        /// handler when an event is raised. If the event handler requires state information, the application must
        /// derive a class from this class to hold the data.
        /// </param>
        void ButtonOkClick(object sender, EventArgs e)
        {
            AutomataForValidateToTreeNode automataForValidateToTreeNode;

            if (treeNodeLN.Nodes.Count != 0)
            {
                RegularExpressionTree regularExpressionTree = new RegularExpressionTree();
                automataForValidateToTreeNode = new AutomataForValidateToTreeNode(treeNodeLN.Nodes[0], regularExpressionTree.GetRegExpToDelete(treeNodeLN.Nodes[0]));
                automataForValidateToTreeNode.InterpretString();
            }
            if (this.bandModify)
            {
                automataForValidateToTreeNode = new AutomataForValidateToTreeNode(this.treeNodeLN, "-DOI/%&*0");
                automataForValidateToTreeNode.InterpretString();
                this.treeViewLNType.EmptyTreeNodeLNType(true);
            }
            else
            {
                this.treeViewLNType.EmptyTreeNodeLNType(false);
            }
            this.Close();
        }
Exemplo n.º 4
0
 /// <summary>
 /// This event saves the information of the DataSet.
 /// </summary>
 /// <param name="sender">
 /// Name of the object.
 /// </param>
 /// <param name="e">
 /// This class contains no event data; it is used by events that do not pass state information to an event
 /// handler when an event is raised. If the event handler requires state information, the application must
 /// derive a class from this class to hold the data.
 /// </param>
 private void OKButtonClick(object sender, EventArgs e)
 {
     if (this.DestinyDataSetListBox.Items.Count > 0)
     {
         this.treeSCL.TreeView.SelectedNode = this.treeViewSCL.SearchUPForBaseTypeAndGetSCLTreeNode(treeSCL, typeof(tAnyLN));
         object lN = this.treeSCL.TreeView.SelectedNode.Tag;
         if (this.dataSetSCL != null)
         {
             this.dataSetSCL.FCDA = null;
         }
         else
         {
             this.dataSetSCL = new tDataSet();
         }
         tFCDA[] fCDAs = new tFCDA[this.DestinyDataSetListBox.Items.Count];
         for (int x = 0; x < this.DestinyDataSetListBox.Items.Count; x++)
         {
             fCDAs[x] = (this.DestinyDataSetListBox.Items[x] as FCDAListBox).fCDA;
         }
         this.dataSetSCL.FCDA = fCDAs;
         this.dataSetSCL.name = this.NameTextBox.Text;
         this.dataSetSCL.desc = this.DescTextBox.Text;
         this.objectManagement.AddObjectToArrayObjectOfParentObject(this.dataSetSCL, lN);
         treeViewSCL.GetNodesItemOfArray((lN as tAnyLN).DataSet, lN.GetType(), this.treeSCL.TreeView.SelectedNode);
         if (this.bandModify)
         {
             RegularExpressionTree         regularExpressionTree         = new  RegularExpressionTree();
             AutomataForValidateToTreeNode automataForValidateToTreeNode = new AutomataForValidateToTreeNode(this.treeSCL,
                                                                                                             regularExpressionTree.GetRegExpToDelete(this.treeSCL));
             automataForValidateToTreeNode.InterpretString();
         }
         this.Close();
     }
     else
     {
         MessageBox.Show("No data has been added to the DataSet");
     }
 }