public FormMain() { InitializeComponent(); _waitingForTerminateProcessList = new List <Process>(); _refreshListDelegate = RemoveItemFromProcessList; _processListLockObj = new object(); _eventLogListLockObj = new object(); _closeProcessesThreadResetEvent = new ManualResetEvent(true); Thread closeProcessesThread = new Thread(CloseSelectedProcesses); closeProcessesThread.Start(); }
private void TestIsDone(FileInfo file, HtmlStore[] htmlStore) { string testName = String.Empty; EndConvertingDelegate endConvertingDelegate = new EndConvertingDelegate(EndConverting); if (htmlStore == null) { SystemMessage.ShowErrorMessage("Ошибка конвертации тестов."); _cancel = true; this.Invoke(endConvertingDelegate, new object[] { }); return; } if (_isUpdate) { BeginUpdateDelegate updateDelegate = new BeginUpdateDelegate(UpdateTest); this.Invoke(updateDelegate, new object[] { file.FullName, htmlStore }); return; } TestorData testorData = HtmlStore.GetDataSet(htmlStore, file, out testName); TestHelper testHelper = new TestHelper(ProjectState.DataPackageManager); testHelper.ConvTime = file.LastWriteTime; testHelper.TestId = testorData.CoreTests[0].TestId; testHelper.FullFileName = file.FullName; testHelper.TestorData = testorData; testHelper.TestName = testName; testHelper.QuestCount = testorData.CoreQuestions.Count(); foreach (var test in testorData.CoreTests) { testHelper.TestKey = test.TestKey.ToString(); } _tests.Add(testHelper); RefreshListDelegate refreshListDelegate = new RefreshListDelegate(RefreshList); this.Invoke(refreshListDelegate, new object[] { testHelper.TestName }); lock (this) { _testCount--; if (_testCount == 0 || _cancel) { this.Invoke(endConvertingDelegate, new object[] { }); return; } ConvertNext(); } }