示例#1
0
        public void RunDialog_Activated(object sender, System.EventArgs a)
        {
            if (!_hasRun)
            {
                statusTextBox.Text = "";

                // let's run the model in a seperate thread so UI can update...
                ProcessAllDelegate processAll = new ProcessAllDelegate(ProcessAll);
                processAll.BeginInvoke(null, null);

                _hasRun = true;
            }
        }
示例#2
0
        void RunAsynch()
        {
            // let's run the model in a seperate thread so UI can update...
            _processAsync = new ProcessAllDelegate(ProcessAll);
            //_asyncResult = _processAsync.BeginInvoke(null, null);
            _asyncResult = _processAsync.BeginInvoke(new AsyncCallback(AsyncCallback), _processAsync);

            //_waitForComplete = new WatchForCompleteDelegate(WatchForComplete);
            //_waitResult = _waitForComplete.BeginInvoke(null, null);
        }
示例#3
0
 void RunAsynch()
 {
     // let's run the model in a seperate thread so UI can update...
     _processAsync = new ProcessAllDelegate(ProcessAll);
     _asyncResult = _processAsync.BeginInvoke(_workbook, null, null);
     //ProcessAllDelegate processAll = new ProcessAllDelegate(ProcessAll);
     //processAll.BeginInvoke(_workbook, null, null);
 }
示例#4
0
 void AsyncCallback(IAsyncResult ar)
 {
     //MessageBox.Show("received asycn callback" + Environment.NewLine + "will now terminate process thread...");
     // Simulation has completed
     _processAsync.EndInvoke(_asyncResult);
     //MessageBox.Show("async process has ended.");
     _processAsync = null;
     _simulation = null;
     //_workbook = null;
     GC.Collect();
     lock (this)
     {
         buttonOK.Enabled = true;
         currentSimulationLabel1.Text = "Successfully completed all simulations";
         toolStripProgressBar1.Value = toolStripProgressBar1.Minimum;
         toolStripStatusLabel1.Text = "done";
     }
 }
示例#5
0
 void RoutingSimulation_OnRunCompleted()
 {
     _processAsync.EndInvoke(_asyncResult);
     _processAsync = null;
     GC.Collect();
 }