private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.cmbMOBAN.SelectedIndex < 0)
            {
                MessageBox.Show("还没有选中模板");
                return;
            }

            if (this.cf.MdiParent is MainForm)
            {
                MainForm mf = this.cf.MdiParent as MainForm;

                this.mainform_initdrawdata_dele = mf.initdrawdata;
                string myLineRoadDesignName = this.cmbMOBAN.SelectedItem.ToString().Trim();
                this.mainform_initdrawdata_dele(myLineRoadDesignName);
            }

            if (this.cf.MdiParent is SuiZuanForm)
            {
                SuiZuanForm szf = this.cf.MdiParent as SuiZuanForm;

                if (szf.zheng_zai_Sui_Zuan_Zhong == true)
                {
                    MessageBox.Show("正在随钻中,无法更改");
                    return;
                }

                this.mainform_initdrawdata_dele = szf.initdrawdata;
                string myLineRoadDesignName = this.cmbMOBAN.SelectedItem.ToString().Trim();
                this.mainform_initdrawdata_dele(myLineRoadDesignName);
            }
        }
Exemple #2
0
        //ÓÒ¼ü²Ëµ¥µã»÷ʼþ
        private void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            string clicked_menu_str = e.ClickedItem.ToString();

            if (clicked_menu_str.Equals("Ëæ×ê"))
            {
                SuiZuanForm szf = this.MdiParent as SuiZuanForm;
                if (szf != null)
                {
                    if (szf.cmbMoBan.SelectedIndex < 0)
                    {
                        MessageBox.Show("ÇëÏÈÑ¡ÔñÄ£°å");
                        return;
                    }
                    if (szf.start_from_Zero == true)
                    {
                        szf.start_SuiZuan();
                        szf.zheng_zai_Sui_Zuan_Zhong = true;
                    }
                    else
                    {
                        szf.continue_SUizuan();
                        szf.zheng_zai_Sui_Zuan_Zhong = false;
                    }
                }
            }

            if (clicked_menu_str.Equals("ÔÝÍ£Ëæ×ê"))
            {
                SuiZuanForm szf = this.MdiParent as SuiZuanForm;
                if (szf != null)
                {
                    bool success = szf.force_Stop_Suizuan();
                    if (success == false)
                    {
                        MessageBox.Show("ÎÞ·¨Í£Ö¹Ëæ×ê");
                        return;
                    }
                    szf.zheng_zai_Sui_Zuan_Zhong = false;
                }
            }

            /**
             * if (clicked_menu_str.Equals("Í£Ö¹Ëæ×ê"))
             * {
             *  SuiZuanForm szf = new SuiZuanForm();
             *  szf.mf = this.mf;
             *
             *  SuiZuanForm father = this.MdiParent as SuiZuanForm;
             *  father.Hide();
             *  this.Hide();
             *  szf.Show();
             *
             *  //
             *  SuiZuanForm szf = this.MdiParent as SuiZuanForm;
             *  if (szf != null)
             *  {
             *
             *
             *      this.Close();
             *      DrawCommonData.icount = 0;
             *      szf.timer1.Enabled = false;
             *      szf.cmbMoBan.SelectedIndex = -1;
             *      SuiZuanForm.zoomed = false;
             *      Childform cf = new Childform();
             *
             *      cf.MdiParent = szf;
             *      cf.WindowState = FormWindowState.Maximized;
             *
             *      szf.zheng_zai_Sui_Zuan_Zhong = false;   //½«¼ÆʱÆ÷¹éÁ㣬·µ»Øµ½Ëæ×ê³õʼ״̬
             *      cf.Show();  //ÖØдò¿ªÒ»¸öchildform
             *      //SuiZuanForm.startpoint != null && SuiZuanForm.zoomed == false
             *      //
             *  }
             * }**/
            if (clicked_menu_str.IndexOf("±ÈÀý³ß") >= 0)
            {
                BiLiChiChangeForm bcf = new BiLiChiChangeForm();
                bcf.Show();
            }

            if (clicked_menu_str.IndexOf("Ä£°å") >= 0)
            {
                SheDingMoBanForm sbmbf = new SheDingMoBanForm();
                sbmbf.cf = this;

                sbmbf.Show();
            }

            if (clicked_menu_str.IndexOf("Éî¶È") >= 0)
            {   //vdFramedControl.BaseControl.ActiveDocument.ActiveLayOut.Entities.AddItem(oneline);
                if (this.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Entities.Count == 0)
                {
                    MessageBox.Show("´íÎ󣬻¹Ã»Óл­Í¼");
                    return;
                }
                //this.find_depth();
                Thread thread = new Thread(this.find_depth);
                thread.Start();
            }
            if (clicked_menu_str.IndexOf("»­Ïß") >= 0)
            {
                if (this.vdScrollableControl1.BaseControl.ActiveDocument.ActiveLayOut.Entities.Count == 0)
                {
                    MessageBox.Show("´íÎ󣬻¹Ã»Óл­Í¼");
                    return;
                }
                this.draw_line();
                //this.vdScrollableControl1.BaseControl.ActiveDocument.CommandAction.CmdLine(null);
            }
        }