コード例 #1
0
 //测试用的重载
 public FormMain()
 {
     InitializeComponent();
     //button2.Click += button1_Click;
     myOperator = new AlgorithmOperator();
     initAll();
 }
コード例 #2
0
        public FormOperating(AlgorithmOperator b, Resourse d, string n)//初始化各控件和属性
        {
            InitializeComponent();
            this.demand = d;
            this.name   = n;
            CheckForIllegalCrossThreadCalls = false;
            this.myOperator = b;
            foreach (Control control in this.Controls)
            {
                if (control is PictureBox)
                {
                    pictureBoxes.Add((PictureBox)control);
                }
            }

            Console.WriteLine(pictureBoxes.Count);
            foreach (Control control in this.groupBox1.Controls)
            {
                if (control is Label)
                {
                    //listBox1.Items.Add(control.Name);
                    avaiLables.Add((Label)control);
                }
            }

            this.label_avaiA.Text = myOperator.available.A.ToString();
            this.label_avaiB.Text = myOperator.available.B.ToString();
            this.label_avaiC.Text = myOperator.available.C.ToString();
            init_draw();
            //listBox1.CheckForIllegalCrossThreadCalls = false;
        }
コード例 #3
0
 public FormMain(MyDictionary <string, int> dic)
 {
     InitializeComponent();
     this.dic = dic;
     //button2.Click += button1_Click;
     myOperator = new AlgorithmOperator(dic);
     initAll();
 }
コード例 #4
0
 private void ResetAll(object sender, EventArgs e)//重置所有值
 {
     this.myOperator = new AlgorithmOperator(dic);
     refresh();
 }