Exemple #1
0
        private void bload_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                erase();
                a = new arb();

                StreamReader file = new StreamReader(openFileDialog1.FileName);
                string       ln;
                Dictionary <string, string[]> d = new Dictionary <string, string[]>();

                while ((ln = file.ReadLine()) != null)
                {
                    string[] x = ln.Split(' ');
                    if (a.len == 0)
                    {
                        a = new arb(Convert.ToDouble(x[0]));
                    }
                    d.Add(x[0], new string[] { x[1], x[2] });
                }
                file.Close();

                addF(a.rad, d);
            }
            display(a.rad, new Point(Width / 2 - 25, 10));
            reset();
        }
Exemple #2
0
        private void init()
        {
            node b = new node(11);

            b.Location = new Point(Width / 2 - 25, 10);
            arbpanel.Controls.Add(b);
            b.Click += delegate(object sender, EventArgs e)
            {
                if (sb != null)
                {
                    sb.BackColor = Color.LightBlue;
                }
                sb           = sender as node;
                sb.BackColor = Color.LightPink;
                reset();
            };

            a = new arb(b);
        }
        private void init()
        {
            node b = new node(11);
            b.Location = new Point(Width/2-25, 10);
            arbpanel.Controls.Add(b);
            b.Click += delegate(object sender, EventArgs e)
            {
                if (sb != null)
                    sb.BackColor = Color.LightBlue;
                sb = sender as node;
                sb.BackColor = Color.LightPink;
                reset();
            };

            a = new arb(b);
        }
        private void bload_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                erase();
                a = new arb();

                StreamReader file = new StreamReader(openFileDialog1.FileName);
                string ln;
                Dictionary<string, string[]> d = new Dictionary<string, string[]>();

                while ((ln = file.ReadLine()) != null)
                {
                    string[] x = ln.Split(' ');
                    if (a.len == 0)
                        a = new arb(Convert.ToDouble(x[0]));
                    d.Add(x[0], new string[] { x[1], x[2] });
                }
                file.Close();

                addF(a.rad, d);

            }
            display(a.rad, new Point(Width / 2 - 25, 10));
            reset();
        }