Esempio n. 1
0
        private void dataGridView2_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (treeView1.SelectedNode.Name == "0")
            {
                Program.t.Name = dataGridSettings.Rows[0].Cells[1].Value.ToString();
                treeView1.SelectedNode.Text = Program.t.Name;
            }
            else
            {
                Element el = Program.getElementById(treeView1.SelectedNode.Name);
                switch (el.GetType().ToString())
                {
                case "VisualTemplate.Signal":
                    Signal s = el as Signal;
                    Program.setSignal(treeView1.SelectedNode, dataGridSettings.Rows[0].Cells[1].Value.ToString());
                    treeView1.SelectedNode.Text = s.ToString();
                    break;

                case "VisualTemplate.Cycle":
                    Program.setCycle(treeView1.SelectedNode, dataGridSettings);
                    Cycle c = el as Cycle;
                    treeView1.SelectedNode.Text = c.ToString();
                    break;
                }
            }
        }
Esempio n. 2
0
        public int CompareTo(object obj)
        {
            Cycle c = obj as Cycle;

            if (Name != null && c.Name != null)
            {
                return(this.Name.ToString().CompareTo(c.Name.ToString()));
            }
            else
            {
                return(this.ToString().CompareTo(c.ToString()));
            }
        }
Esempio n. 3
0
        private void dataGridView2_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            TreeNode TrNdSel = curTempTabPage.TreeView.SelectedNode;

            if (TrNdSel.Name == "0")
            {
                curTempTabPage.Template.Name = curTempTabPage.dgSettings.Rows[0].Cells[1].Value.ToString();
                TrNdSel.Text = curTempTabPage.Template.Name;
                curTempTabPage.TabPage.Text = curTempTabPage.Template.Name;
                if (oldFileName != curTempTabPage.Template.Name)
                {
                    curTempTabPage.Template.CurPath = null;
                }
                curTempTabPage.Changed = true;
            }
            else
            {
                Element el = Program.getElementById(TrNdSel.Name, tabControl2.SelectedIndex);
                switch (el.GetType().ToString())
                {
                case "VisualTemplate.Signal":
                    Signal s = el as Signal;
                    Program.setSignal(curTempTabPage);
                    //Program.setSignal(TrNdSel, curTempTabPage.dgSettings.Rows[0].Cells[1].Value.ToString());
                    TrNdSel.Text = s.ToString();
                    break;

                case "VisualTemplate.Cycle":
                    Program.setCycle(curTempTabPage);
                    Cycle c = el as Cycle;
                    TrNdSel.Text = c.ToString();
                    break;
                }
            }
            if (!curTempTabPage.Changed)
            {
                curTempTabPage.TabPage.Text += "*";
            }
        }