private void bgwCreateFFMSIndexBatchFile_DoWork(object sender, DoWorkEventArgs e) { IFFMSIndexBatchFileWriteService batchFileWriteService = e.Argument as FFMSIndexBatchFileWriteService; batchFileWriteService.Write(); e.Result = batchFileWriteService; }
private void bgwCreateFFMSIndexBatchFile_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { IFFMSIndexBatchFileWriteService batchFileWriteService = e.Result as FFMSIndexBatchFileWriteService; if (batchFileWriteService.Errors.Count() == 0) { MessageBox.Show("ffmsindex Batch File created!", "Process Complete", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(string.Format("Error: {0}", batchFileWriteService.Errors[0].Description), "Error occurred", MessageBoxButtons.OK, MessageBoxIcon.Error); } gbScreen.SetEnabled(true); }