public void Run()
{
for (int i = 0; i < m_oBuilder.Count; i++)
{
if (m_oBuilder.RunAllSteps ||
(i >= m_oBuilder.StepStart && i <= m_oBuilder.StepEnd))
{
BuildStep oStep = m_oBuilder.Get(i);
if (StepStarted != null)
{
StepStarted(i);
}
try
{
oStep.Run();
}
catch (Exception e)
{
if (StepError != null)
{
StepError(i, e.Message);
}
break;
}
if (StepCompleted != null)
{
StepCompleted(i);
}
}
if (m_EventStop.WaitOne(1))
{
break;
}
}
// Make synchronous call to main form
// to inform it that thread finished
if (ThreadFinished != null)
{
ThreadFinished();
}
// Reset the event
m_EventStopped.Set();
}