void _worker_DoWork(object sender, DoWorkEventArgs e) { _scriptRunner = ObjectFactory.GetInstance<IScriptRunner>(); _scriptRunner.FileRan += _scriptRunner_FileRan; if (_runAtomic) _scriptRunner.RunScriptsAtomic(_server, _scripts); else _scriptRunner.RunScripts(_server, _scripts); }