Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var alg             = new ClopeAlg <int>();
            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork += new DoWorkEventHandler(new Action <object, DoWorkEventArgs>((o, dwe) =>
            {
                BeginInvoke(new Action(() =>
                {
                    button1.Enabled = false;
                }));

                double r;
                if (!double.TryParse(tbRepulsion.Text, out r))
                {
                    MessageBox.Show("Коэффициент отталкивания введён в неправильном формате!");
                    return;
                }

                ClopeAlg <int> .Clasterization(treader, r, clasterset);
            }));

            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(new Action <object, RunWorkerCompletedEventArgs>((o, wce) =>
            {
                BeginInvoke(new Action(() => { RefreshGrid(); }));
            }));

            bw.RunWorkerAsync();
        }
Exemplo n.º 2
0
 private void InitFirst(double r)
 {
     MashDataSet.CreateDataFile();
     treader    = new TransactionReader();
     clasterset = ClopeAlg <int> .Initialiazation(treader, r);
 }