Esempio n. 1
0
 private void AddUserSearchTerms(List<string> topicTerms)
 {
     string extraSearchTermPath = Configures.GetManualSearchTermPath();
     if (!File.Exists(extraSearchTermPath))
     {
         return;
     }
     else
     {
         string[] lines = FileOperators.ReadFileLines(extraSearchTermPath);
         foreach (string line in lines)
         {
             if (line.Contains(":"))
             {
                 int commaIndex = line.IndexOf(":");
                 string compName = line.Substring(0, commaIndex);
                 if (compName.Equals(targetTopicName))
                 {
                     string extraTermStr = line.Substring(commaIndex + 1);
                     string[] extraTerms = extraTermStr.Split(',');
                     foreach (string extraTerm in extraTerms)
                     {
                         string trimmedTerm = extraTerm.Trim();
                         if (!topicTerms.Contains(trimmedTerm))
                         {
                             topicTerms.Add(trimmedTerm);
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 2
0
        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());
            //}
        }
Esempio n. 3
0
        private void searchTermPath_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location;
            openFileDialog.Filter           = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
            openFileDialog.FilterIndex      = 2;
            openFileDialog.RestoreDirectory = true;
            tbSearchTermPath.Text           = Configures.GetManualSearchTermPath();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                this.tbSearchTermPath.Text = openFileDialog.FileName;
            }
        }
Esempio n. 4
0
 private void ImportManualDataWindow_Load(object sender, EventArgs e)
 {
     tbRawFileFolder.Text  = Configures.GetManualRawMaterialFileDir();
     tbModelFilePath.Text  = Configures.GetManualModelFilePath();
     tbSearchTermPath.Text = Configures.GetManualSearchTermPath();
 }