Beispiel #1
0
        private void readXmlNode(XmlNode pRoot)
        {
            if (pRoot.ChildNodes.Count != 4)
            {
                MessageBox.Show("target xml do not cotain 4 round , read failed");
                return;
            }

            hideAllNodeSettingPanel();
            this.treeView1.Nodes.Clear();
            XmlNode pRound = pRoot.FirstChild;

            for (; pRound != null; pRound = pRound.NextSibling)
            {
                Console.WriteLine("node {0}", pRoot.Name);
                NodeRound pdata = new NodeRound(0);
                pdata.readFromXmlElement(pRound);
                // add data to tree view ;
                this.treeView1.Nodes.Add(bindNodeDataToTreeNode(pdata));
            }
        }
Beispiel #2
0
        private void 新建文档ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            // check if save current document ;
            if (m_eDocState == eDocState.eDoc_Modified)
            {
                DialogResult dlgret = MessageBox.Show("是否保存当前文档", "notices", MessageBoxButtons.YesNoCancel);
                if (dlgret == DialogResult.Cancel)
                {
                    return;
                }
                else if (dlgret == DialogResult.Yes)
                {
                    this.保存ToolStripMenuItem_Click(sender, e);
                }
                else
                {
                    m_eDocState = eDocState.eDoc_None;
                }
            }

            if (eDocState.eDoc_Modified == m_eDocState)
            {
                MessageBox.Show("cur document do not process can not create new");
                return;
            }

            hideAllNodeSettingPanel();
            this.treeView1.Nodes.Clear();
            for (int nIdx = 0; nIdx < 4; ++nIdx)
            {
                TreeNode  pRound = new TreeNode();
                NodeRound tRound = new NodeRound(nIdx);
                pRound.Tag  = tRound;
                pRound.Text = tRound.desc;
                this.treeView1.Nodes.Add(pRound);
            }
            m_eDocState     = eDocState.eDoc_NewCreated;
            m_strCurDocPath = null;
            this.Text       = "untitled";
        }
Beispiel #3
0
        private void 新建文档ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            // check if save current document ;
            if ( m_eDocState == eDocState.eDoc_Modified)
            {
                DialogResult dlgret = MessageBox.Show("是否保存当前文档", "notices", MessageBoxButtons.YesNoCancel);
                if (dlgret == DialogResult.Cancel)
                {
                    return;
                }
                else if (dlgret == DialogResult.Yes)
                {
                    this.保存ToolStripMenuItem_Click(sender, e);
                }
                else
                {
                    m_eDocState = eDocState.eDoc_None;
                }
            }

            if (eDocState.eDoc_Modified == m_eDocState)
            {
                MessageBox.Show("cur document do not process can not create new");
                return;
            }

            hideAllNodeSettingPanel();
            this.treeView1.Nodes.Clear();
            for ( int nIdx = 0; nIdx < 4; ++nIdx )
            {
                TreeNode pRound = new TreeNode() ;
                NodeRound tRound = new NodeRound(nIdx);
                pRound.Tag = tRound;
                pRound.Text = tRound.desc;
                this.treeView1.Nodes.Add(pRound);
            }
            m_eDocState = eDocState.eDoc_NewCreated;
            m_strCurDocPath = null;
            this.Text = "untitled";
        }
Beispiel #4
0
        private void readXmlNode(XmlNode pRoot)
        {
            if (pRoot.ChildNodes.Count != 4)
            {
                MessageBox.Show("target xml do not cotain 4 round , read failed");
                return;
            }

            hideAllNodeSettingPanel();
            this.treeView1.Nodes.Clear();
            XmlNode pRound = pRoot.FirstChild;
            for (; pRound != null; pRound = pRound.NextSibling)
            {
                Console.WriteLine("node {0}", pRoot.Name);
                NodeRound pdata = new NodeRound(0);
                pdata.readFromXmlElement(pRound);
                // add data to tree view ;
                this.treeView1.Nodes.Add(bindNodeDataToTreeNode(pdata));
            }
        }