示例#1
0
 private void bCreatePool_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Wipe out and recreate the pool?", "Create Pool", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
     {
         ThreadPool.QueueUserWorkItem(x => BatchServiceClient.ReCreatePool());
     }
 }
示例#2
0
 private void bDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Delete all your workitems?", "Delete", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
     {
         ThreadPool.QueueUserWorkItem(x => BatchServiceClient.Delete());
     }
 }
示例#3
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     while (true)
     {
         try
         {
             string log = BatchServiceClient.FetchLog();
             if (string.IsNullOrEmpty(log))
             {
                 Thread.Sleep(1000);
                 TaskbarManager.Instance.SetProgressValue(BatchServiceClient.progress, 100);
                 pbJobProgress.Invoke((MethodInvoker) delegate() { pbJobProgress.Value = BatchServiceClient.progress; });
                 if (!BatchServiceClient.IsRunning())
                 {
                     TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.NoProgress);
                 }
             }
             else
             {
                 tbLogs.Invoke((MethodInvoker) delegate() { tbLogs.AppendText(log + "\n"); });
             }
         }
         catch
         {
             break;
         }
     }
 }
示例#4
0
        private void bSubmit_Click(object sender, EventArgs e)
        {
            Settings.inputContainer    = cbInput.Text;
            Settings.resourceContainer = cbResource.Text;
            Settings.outputContainer   = cbOutput.Text;

            ThreadPool.QueueUserWorkItem(x =>
            {
                BatchServiceClient.Submit();
            });
        }
示例#5
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (BatchServiceClient.IsRunning())
     {
         DialogResult res = MessageBox.Show("Do you want to terminate job before quit?", "Info", MessageBoxButtons.YesNoCancel);
         if (res == System.Windows.Forms.DialogResult.Cancel)
         {
             e.Cancel = true;
         }
         else if (res == System.Windows.Forms.DialogResult.Yes)
         {
             BatchServiceClient.Terminate();
         }
     }
 }
示例#6
0
 private void bTerminate_Click(object sender, EventArgs e)
 {
     ThreadPool.QueueUserWorkItem(x => BatchServiceClient.Terminate());
 }