コード例 #1
0
 public void startProgressBarAnimation()
 {
     if (ParentForm != null)
     {
         ParentForm.Closed += (a, b) => runAnnimation = false;
     }
     progressBar.Maximum = 100;
     progressBar.Value   = 0;
     runAnnimation       = true;
     O2Thread.mtaThread(
         () => {
         while (runAnnimation)
         {
             timeElapsed += 1;
             Thread_Invoke_ExtensionMethods.invokeOnThread(progressBar, () =>
             {
                 lbTimeElapsed.Text = "{0} Sec".format(timeElapsed);
                 progressBar.Value++;
                 if (progressBar.Value >= progressBar.Maximum)
                 {
                     progressBar.Value = 0;
                 }
             });
             System.Threading.Thread.Sleep(1000);
         }
     });
 }
 public void showO2TraceTree()
 {
     Thread_Invoke_ExtensionMethods.invokeOnThread(tvSmartTrace, () =>
     {
         if (o2Finding != null)
         {
             tvSmartTrace.Visible = false;
             tvSmartTrace.Nodes.Clear();
             foreach (IO2Trace chilldO2Trace in o2Finding.o2Traces)
             {
                 loadO2TraceIntoTreeNodeCollection(chilldO2Trace, tvSmartTrace.Nodes);
             }
             tvSmartTrace.ExpandAll();
             if (DontSelectNodeOnLoad.isFalse())
             {
                 if (tvSmartTrace.Nodes.Count > 0 && tvSmartTrace.SelectedNode == null)
                 {
                     tvSmartTrace.SelectedNode = tvSmartTrace.Nodes[0];
                 }
             }
             tvSmartTrace.Visible = true;
         }
         return(default(object));
     });
 }
 public void loadO2Finding(IO2Finding _o2Finding)
 {
     Thread_Invoke_ExtensionMethods.invokeOnThread((Control)this, () =>
     {
         o2Finding = _o2Finding;
         showO2TraceTree();
         return(default(object));
     });
 }
 private void btDeleteTempFolderContents_Click(object sender, EventArgs e)
 {
     if (DialogResult.Yes ==
         MessageBox.Show(
             "Are you sure you want to delete the entire contents of the folder " + PublicDI.config.O2TempDir + " ?",
             "Confirm O2 Temp Folder deletion (after deletion, an empty folder will be created)",
             MessageBoxButtons.YesNo))
     {
         O2Thread.mtaThread(
             () =>
         {
             Thread_Invoke_ExtensionMethods.invokeOnThread((Control)this, (Func <object>)(() => lbMessage_DeletingTempFolder.Visible = true));
             Files.deleteFolder(PublicDI.config.O2TempDir, true);
             Files.checkIfDirectoryExistsAndCreateIfNot(PublicDI.config.O2TempDir, true);
             Thread_Invoke_ExtensionMethods.invokeOnThread((Control)this, (Func <object>)(() => lbMessage_O2TempFolderContentsDeleted.Visible = true));
         }
             );
     }
 }