コード例 #1
0
ファイル: Form1.cs プロジェクト: nnadboralski-zz/C-CodeDump
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dr = ofdConcentra.ShowDialog();
            if (dr != DialogResult.Abort || dr != DialogResult.Cancel)
            {
                ReadConcentraFileV2(ofdConcentra.FileName);
            }

            foreach (LFNode l in lfList)
            {
                for (int i = 0; i < lfList.Count(); i++)
                {
                    if (l.PID == lfList[i].ID)
                    {
                        lfList[i].Children.Add(l.ID);
                        // lfDict[lfList[i].ID].Children.Add(l.ID);
                    }
                }
            }
            LFTreeNode tn = new LFTreeNode(lfDict["root"]);
            foreach (string s in lfDict["root"].Children)
            {
                LoadTreeView(tn, lfDict[s]);
            }

            tvLogicFlow.Nodes.Add(tn);
        }
コード例 #2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dr = ofdConcentra.ShowDialog();

            if (dr != DialogResult.Abort || dr != DialogResult.Cancel)
            {
                ReadConcentraFileV2(ofdConcentra.FileName);
            }

            foreach (LFNode l in lfList)
            {
                for (int i = 0; i < lfList.Count(); i++)
                {
                    if (l.PID == lfList[i].ID)
                    {
                        lfList[i].Children.Add(l.ID);
                        // lfDict[lfList[i].ID].Children.Add(l.ID);
                    }
                }
            }
            LFTreeNode tn = new LFTreeNode(lfDict["root"]);

            foreach (string s in lfDict["root"].Children)
            {
                LoadTreeView(tn, lfDict[s]);
            }

            tvLogicFlow.Nodes.Add(tn);
        }
コード例 #3
0
        private void UpdateIDs(LFTreeNode lfTN)
        {
            lfTN.LogicFlow.ID = "root";
            int counter = 1;

            foreach (LFTreeNode child in lfTN.Nodes)
            {
                string id = counter.ToString();
                UpdateIDs(child, counter, id);
                counter++;
            }
        }
コード例 #4
0
        private void UpdateIDs(LFTreeNode lfTN, int c, string id)
        {
            lfTN.LogicFlow.ID = id;
            int counter = 1;

            foreach (LFTreeNode child in lfTN.Nodes)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append(id + "." + counter.ToString());
                UpdateIDs(child, counter, sb.ToString());
                counter++;
            }
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: nnadboralski-zz/C-CodeDump
 private void LoadTreeView(LFTreeNode parent, LFNode child)
 {
     LFTreeNode newNode = new LFTreeNode(child);
     newNode.Tag = child;
     parent.Nodes.Add(newNode);
     foreach (string s in child.Children)
     {
         if (child.Children.Count != 0)
         {
             LoadTreeView(newNode, lfDict[s]);
         }
     }
 }
コード例 #6
0
        private void LoadTreeView(LFTreeNode parent, LFNode child)
        {
            LFTreeNode newNode = new LFTreeNode(child);

            newNode.Tag = child;
            parent.Nodes.Add(newNode);
            foreach (string s in child.Children)
            {
                if (child.Children.Count != 0)
                {
                    LoadTreeView(newNode, lfDict[s]);
                }
            }
        }
コード例 #7
0
        private void tvLogicFlow_AfterSelect(object sender, TreeViewEventArgs e)
        {
            foreach (LFTreeNode N in tvLogicFlow.Nodes)
            {
                UpdateIDs(N);
            }

            LFTreeNode selected = (LFTreeNode)e.Node;

            txtContent.Text          = selected.LogicFlow.Text;
            textBox2.Text            = selected.LogicFlow.ID;
            lblCurrentNodeValue.Text = selected.LogicFlow.ID;
            txtSCB.Text     = selected.LogicFlow.ShowCheckBox;
            txtEL2Code.Text = selected.LogicFlow.EndLevel2Code;
        }
コード例 #8
0
        private void tvLogicFlow_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.X && e.Modifiers == Keys.Control)
            {
                clipboard = ((LFTreeNode)tvLogicFlow.SelectedNode);
                if (clipboard.LogicFlow.ID == "root")
                {
                    MessageBox.Show("Can not cut the root node.");
                    return;
                }

                tvLogicFlow.SelectedNode.Remove();
            }
            if (e.KeyCode == Keys.V && e.Modifiers == Keys.Control)
            {
                tvLogicFlow.SelectedNode.Nodes.Insert(0, (LFTreeNode)clipboard);
                clipboard = null;
            }
            if (e.KeyCode == Keys.Insert)
            {
                tvLogicFlow.SelectedNode.Nodes.Insert(0, new LFTreeNode(new LFNode()));
                tvLogicFlow.SelectedNode.Nodes[0].BackColor = Color.Red;
            }
        }
コード例 #9
0
ファイル: Form1.cs プロジェクト: nnadboralski-zz/C-CodeDump
 private void UpdateIDs(LFTreeNode lfTN, int c, string id)
 {
     lfTN.LogicFlow.ID = id;
     int counter = 1;
     foreach (LFTreeNode child in lfTN.Nodes)
     {
         StringBuilder sb = new StringBuilder();
         sb.Append(id + "." + counter.ToString());
         UpdateIDs(child, counter, sb.ToString());
         counter++;
     }
 }
コード例 #10
0
ファイル: Form1.cs プロジェクト: nnadboralski-zz/C-CodeDump
 private void UpdateIDs(LFTreeNode lfTN)
 {
     lfTN.LogicFlow.ID = "root";
     int counter = 1;
     foreach (LFTreeNode child in lfTN.Nodes)
     {
         string id = counter.ToString();
         UpdateIDs(child, counter, id);
         counter++;
     }
 }
コード例 #11
0
ファイル: Form1.cs プロジェクト: nnadboralski-zz/C-CodeDump
        private void tvLogicFlow_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.X && e.Modifiers == Keys.Control)
            {

                clipboard = ((LFTreeNode)tvLogicFlow.SelectedNode);
                if (clipboard.LogicFlow.ID == "root")
                {
                    MessageBox.Show("Can not cut the root node.");
                    return;
                }

                tvLogicFlow.SelectedNode.Remove();
            }
            if (e.KeyCode == Keys.V && e.Modifiers == Keys.Control)
            {
                tvLogicFlow.SelectedNode.Nodes.Insert(0,(LFTreeNode)clipboard);
                clipboard = null;
            }
            if (e.KeyCode == Keys.Insert)
            {
                tvLogicFlow.SelectedNode.Nodes.Insert(0, new LFTreeNode(new LFNode()));
                tvLogicFlow.SelectedNode.Nodes[0].BackColor = Color.Red;
            }
        }