Ejemplo n.º 1
0
 /// <summary>
 /// Полный сброс
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         cancelToken.Cancel();
         cancelToken.Dispose();
     }
     catch {
     }
     fileSearcher = null;
     cancelToken  = new CancellationTokenSource();
     newRun       = true;
     timer.Stop();
     button1.Enabled = true;
     treeView1.Nodes.Clear();
     treeView1.Update();
     progressBar1.Value   = 0;
     progressBar1.Visible = true;
     label1.Text          = "";
     label6.Text          = "";
     label3.Text          = "";
     label4.Text          = "";
     button2.Text         = button2Text[Convert.ToInt32(button2Pos.RUN)];
     button3.Visible      = false;
     chapter = 1;
 }
Ejemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     using (var fbd = new FolderBrowserDialog())
     {
         DialogResult result = fbd.ShowDialog();
         var          path   = fbd.SelectedPath;
         if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(path))
         {
             button3_Click(null, null);
             fileSearcher = new SearchOperator(path);
             fileSearcher.onCurrentScanFile += (a, args) =>
             {
                 var ar = args as CustomArgs;
                 currentFile = ar.fileName;
             };
             label1.Text = path;
         }
     }
 }