Ejemplo n.º 1
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            if (thread != null && thread.IsParcasi.IsAlive)
            {
                thread.IsParcasi.Abort();
                StartOperations();
            }
            else
            {
                if (!string.IsNullOrEmpty(txtKlasor.Text.Trim()) ||
                    !string.IsNullOrEmpty(txtUzantı.Text.Trim()) ||
                    !string.IsNullOrEmpty(txtEskiDeger.Text.Trim()) ||
                    !string.IsNullOrEmpty(txtYeniDeger.Text.Trim()))
                {
                    StopOperations();

                    thread = new UpdateThread(txtKlasor.Text, txtUzantı.Text, txtEskiDeger.Text,
                                              txtYeniDeger.Text, rdoRecursive.Checked ? true : false);

                    thread.OnLogEvent       += this.Log;
                    thread.OnStopEvent      += this.StopOperations;
                    thread.OnCompletedEvent += this.DisableEnableComponents;

                    thread.IsParcasi.Start();
                }
                else
                {
                    MessageBox.Show(this, Properties.Resources.strEksikbilgi, Properties.Resources.strHataCaption, MessageBoxButtons.OK);
                }
            }
        }
Ejemplo n.º 2
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            if (thread != null && thread.IsParcasi.IsAlive)
            {
                thread.IsParcasi.Abort();
                StartOperations();
            }
            else
            {
                if (!string.IsNullOrEmpty(txtKlasor.Text.Trim()) ||
                    !string.IsNullOrEmpty(txtUzantı.Text.Trim()) ||
                    !string.IsNullOrEmpty(txtEskiDeger.Text.Trim()) ||
                    !string.IsNullOrEmpty(txtYeniDeger.Text.Trim()))
                {
                    StopOperations();

                    thread = new UpdateThread(txtKlasor.Text, txtUzantı.Text, txtEskiDeger.Text,
                        txtYeniDeger.Text, rdoRecursive.Checked ? true : false);
                    
                    thread.OnLogEvent += this.Log;
                    thread.OnStopEvent += this.StopOperations;
                    thread.OnCompletedEvent += this.DisableEnableComponents;

                    thread.IsParcasi.Start();
                }
                else
                {
                    MessageBox.Show(this, Properties.Resources.strEksikbilgi, Properties.Resources.strHataCaption, MessageBoxButtons.OK);
                }
            }
        }