Ejemplo n.º 1
0
        private void btn_scan_Click(object sender, EventArgs e)
        {
            dataGridView_scanning.Rows.Clear();
            progressBar_scan.Value = 0;

            Address start = new Address(
                Decimal.ToInt32(nud1.Value),
                Decimal.ToInt32(nud2.Value),
                Decimal.ToInt32(nud3.Value),
                Decimal.ToInt32(nud4.Value));
            Address finish = new Address(
                Decimal.ToInt32(nud5.Value),
                Decimal.ToInt32(nud6.Value),
                Decimal.ToInt32(nud7.Value),
                Decimal.ToInt32(nud8.Value));

            Debug.WriteLine(start);
            Debug.WriteLine(finish);
            Task.Factory.StartNew(() =>
            {
                ArrayList l = new ArrayList();
                Task t      = Task.Factory.StartNew(() =>
                {
                    l = _generator.generate(start, finish);
                });
                Task.WaitAll(t);
                BarUpdater barUpdater = new BarUpdater(progressBar_scan, l.Count);
                Debug.WriteLine("Generation complete");
                Scunner scunner = new Scunner(l);
                scunner.scan(new  ScunnerOutputContent(dataGridView_scanning, barUpdater));
            });


            Debug.WriteLine("exit");
        }
Ejemplo n.º 2
0
 public ScunnerOutputContent(DataGridView dataGridView, BarUpdater barUpdater)
 {
     this.dataGridView = dataGridView;
     this._barUpdater  = barUpdater;
 }