Ejemplo n.º 1
0
 /// <summary>
 /// Perfoms silent recursive processing for multiple directories
 /// </summary>
 /// <param name="args"></param>
 static void ComposeMultiWell(string[] args)
 {
     try
     {
         SlideDescriptionFile sdp = new SlideDescriptionFile(args[0]);
         sdp.ComposeSlides(args[1], args[2]);
         DirectoryInfo di = new DirectoryInfo(args[1]);
         if (!di.Exists)
         {
             throw new Exception(args[1] + "not found");
         }
         DirectoryInfo[] dis = di.GetDirectories();
         if (!Directory.Exists(args[2]))
         {
             Directory.CreateDirectory(args[2]);
         }
         foreach (DirectoryInfo dd in dis)
         {
             string src = args[1] + "\\" + dd.Name;
             string dst = args[2] + "\\" + dd.Name;
             sdp.ComposeSlides(src, dst);
             Console.WriteLine("Processing completed for " + dst);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
     return;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Performs processing of a single folder; also handles "Cancel" press
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button4_Click(object sender, EventArgs e)
 {
     if (button4.Text == "Cancel")
     {
         backgroundWorker1.CancelAsync();
     }
     if (backgroundWorker1.IsBusy)
     {
         return;
     }
     if (SaveDefinitions())
     {
         return;
     }
     try
     {
         sdp = new SlideDescriptionFile(textBox1.Text);
         inputList.Clear();
         outputList.Clear();
         inputList.Add(textBox3.Text);
         outputList.Add(textBox4.Text);
         outputMessage = "";
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     SetControls(false);
     backgroundWorker1.RunWorkerAsync();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Perfoms silent processing for single directory
 /// </summary>
 /// <param name="args"></param>
 static void ComposeSingleWell(string[] args)
 {
     try
     {
         SlideDescriptionFile sdp = new SlideDescriptionFile(args[0]);
         sdp.ComposeSlides(args[1], args[2]);
         Console.WriteLine("Processing completed for " + args[2]);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Performs processing of multiple folders
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button5_Click(object sender, EventArgs e)
 {
     if (backgroundWorker1.IsBusy)
     {
         return;
     }
     if (SaveDefinitions())
     {
         return;
     }
     try
     {
         sdp = new SlideDescriptionFile(textBox1.Text);
         inputList.Clear();
         outputList.Clear();
         DirectoryInfo di = new DirectoryInfo(textBox3.Text);
         if (!di.Exists)
         {
             throw new Exception(textBox3.Text + "not found");
         }
         DirectoryInfo[] dis = di.GetDirectories();
         if (!Directory.Exists(textBox4.Text))
         {
             Directory.CreateDirectory(textBox4.Text);
         }
         foreach (DirectoryInfo dd in dis)
         {
             string src = textBox3.Text + "\\" + dd.Name;
             string dst = textBox4.Text + "\\" + dd.Name;
             inputList.Add(src);
             outputList.Add(dst);
         }
         outputMessage = "";
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     SetControls(false);
     backgroundWorker1.RunWorkerAsync();
 }