コード例 #1
0
        private void butAddNewThread_Click(object sender, EventArgs e)
        {
            ThreadUserControl thread = new ThreadUserControl("Thread #" + (threadCount + 1), k1, k2);

            thread.PropertyChanged += Thread_PropertyChanged;
            thread.SetInstanceInfiniteMode(cbInfiniteExecution.Checked);
            programExecutionPanel.Controls.Add(thread);
            threadStatuses.Add(thread.ThreadID, false);
            threadCount++;
            lbThreadCount.Text = string.Format("Thread Count: {0}", threadCount);
            butStart.Visible   = true;
        }
コード例 #2
0
 private void AddNewThread(int numThread, int numInstance)
 {
     for (int i = 0; i < numThread; i++)
     {
         ThreadUserControl thread = new ThreadUserControl("Thread #" + (threadCount + 1), k1, k2, true);
         thread.PropertyChanged += Thread_PropertyChanged;
         thread.SetInstanceInfiniteMode(cbInfiniteExecution.Checked);
         programExecutionPanel.Controls.Add(thread);
         threadStatuses.Add(thread.ThreadID, false);
         threadCount++;
         lbThreadCount.Text = string.Format("Thread Count: {0}", threadCount);
         thread.AddGreenC5Instance(numInstance);
     }
 }