Hello,
So basically i'm looping over some array and for each item I want to start a new process and when it ends, carry on with the next one...
Here is the code (I'm calling this from another thread) the view.console object is ConsoleControl.WPF
foreach (string word in words)
{
bool isRunning = view.console.Dispatcher.Invoke(() => view.console.IsProcessRunning);
while (isRunning)
{
//Wait and query again after 250ms
//Thread.Sleep(250);
isRunning = view.console.Dispatcher.Invoke(() => view.console.IsProcessRunning);
}
view.console.Dispatcher.Invoke(new Action<string, string>(view.console.StartProcess), executablePath, cliArguments + word);
}
The only way I could get it to work is with that Thread.Sleep() in the while loop.
Am I doing something wrong, or is this a bug?
Btw, when I run the code in step-by-step in VS it works fine.
Hello,
So basically i'm looping over some array and for each item I want to start a new process and when it ends, carry on with the next one...
Here is the code (I'm calling this from another thread) the view.console object is ConsoleControl.WPF
The only way I could get it to work is with that Thread.Sleep() in the while loop.
Am I doing something wrong, or is this a bug?
Btw, when I run the code in step-by-step in VS it works fine.