private void createFromManualDataToolStripMenuItem_Click(object sender, EventArgs e) { ImportManualDataWindow dlg = new ImportManualDataWindow(); DialogResult dr = dlg.ShowDialog(); if (dr == DialogResult.OK) { scMainPanel.Panel2Collapsed = false; scOutputResult.Panel1Collapsed = true; scOutputResult.Panel2Collapsed = false; string[] paths = { dlg.RawFileDir, dlg.ModelFilePath }; backgroundWorker = new BackgroundWorker(); backgroundWorker.WorkerReportsProgress = true; backgroundWorker.DoWork += new DoWorkEventHandler(GenerateManualData_DoWork); backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(GenerateManualData_ProgressChanged); backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(GenerateManualData_Completed); backgroundWorker.RunWorkerAsync(paths); } else if (dr == DialogResult.Retry) { RenderManualData(Configures.GetManualModelFilePath(), Configures.GetManualSearchTermPath()); } //step by step //GenerateManualDataWizard dlg = new GenerateManualDataWizard(); //DialogResult dr = dlg.ShowDialog(); //if (dr == DialogResult.OK) //{ // RenderManualData(Configures.GetManualWizardModelFilePath()); //} }
private void GenerateManualData_Completed(object sender, RunWorkerCompletedEventArgs e) { if (!(bool)(e.Result)) { MessageBox.Show("Generating manual model failed! Please check the ouput window to fix the problem and run again.", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning); } RenderManualData(Configures.GetManualModelFilePath(), FileMg.ManualTopicLabelFileDir + Constants.TopicManualTermFileName); }
private void ImportManualDataWindow_Load(object sender, EventArgs e) { tbRawFileFolder.Text = Configures.GetManualRawMaterialFileDir(); tbModelFilePath.Text = Configures.GetManualModelFilePath(); tbSearchTermPath.Text = Configures.GetManualSearchTermPath(); }