Exemple #1
0
        private void startGenerateButton_Click(object sender, EventArgs e)
        {
            InitFormItem();
            InitText();

            try
            {
                drawNet1 = new DrawNet(graph, new Network(int.Parse(textBoxCityNum.Text), int.Parse(textBoxLineNum.Text)));
            }
            catch (InvalidParamException excp)
            {
                InitFormItem();

                textBoxCityNum.Text  = excp.n.ToString();
                warningLabel.Text    = string.Format("城市数为{0}时,m的范围应为[{1},{2}]", excp.n, excp.mLower, excp.mUpper);
                warningLabel.Visible = true;
                return;
            }
            catch (FormatException)
            {
                InitFormItem();
                warningLabel.Text    = "请输入数据(使用阿拉伯数字)";
                warningLabel.Visible = true;
                return;
            }

            drawNet1.DrawNormalGraphic();

            generateNetwork2Button.Enabled    = true;
            tellDependablility1Button.Enabled = true;
            equipSwitchButton1.Enabled        = true;
            equipSwitchButton2.Enabled        = false;
        }
Exemple #2
0
        private void generateNetwork2Button_Click(object sender, EventArgs e)
        {
            InitText();

            drawNet2 = new DrawNet(drawNet1);
            drawNet2.Net.RemoveRedundantLines();
            drawNet2.DrawNormalGraphic();

            equipSwitchButton2.Enabled = true;
            saveNetworkButton.Enabled  = true;
        }