private void lookUpFullText_Click(object sender, EventArgs e) { string keyword = cbxKeyWord.Text; Boolean isPathChanged = false; if (preTestFileName != testFileName) { isPathChanged = true; preTestFileName = testFileName; } if (keyword.Trim() != "") { KeyWordCache.putKeyWordInCache(keyword, KeyWordCache.KEYWORD); KeyWordCache.update(cbxKeyWord, KeyWordCache.KEYWORD); if (testFileName != "")//检查输入不为空 { FullTextLookUp fullTextLookUp = new FullTextLookUp(); word = fullTextLookUp.fullTextCheck(testFileName, isPathChanged, keyword, oldKeyWord, keywordChanged, word); oldKeyWord = keyword; keywordChanged = false; } else { MessageBox.Show("输入路径不能为空"); tabControl2.SelectTab("tabPageTest"); } } else { MessageBox.Show("请输入关键字"); } }
private void initKeyWordList() { List <string> result = KeyWordCache.getAllKeyWordCache(); foreach (string s in result) { cbxKeyWord.Items.Add(s); } cbxKeyWord.Update(); }
private Boolean ifExecuted = false;//判断单文档关键字查询是否执行了 private void btnFindKeyWord_Click(object sender, EventArgs e) { string keyword = cbxKeyWord.Text; if (keyword.Trim() != "") { KeyWordCache.putKeyWordInCache(keyword, KeyWordCache.KEYWORD); KeyWordCache.update(cbxKeyWord, KeyWordCache.KEYWORD); tabControl2.SelectTab("tabPageFind"); if (checkKeyWordInput(testFileName, multiTestFilePath, multiRegFilePath, multiSpecFilePath) == true)//检查输入不为空 { KeyWord keyWord = new KeyWord(); if (!isMultiple)//danwendang { if (testDoc != null) { if (!testFileName.Equals(preTestFileName) || keywordChanged)//如果路径改变或者关键字改变则认为关键字查询没有执行 { ifExecuted = false; } if (!testFileName.Equals(preTestFileName) || keywordChanged || !ifExecuted) { WaitingForm wf = new WaitingForm(); HandleWaitingForm.startWaitingForm(wf); if (!testDocIsOpen) { testDocIsOpen = true; testDoc = handleDocument.openDocument(testFileName, testWord); } keyWord.highLightKeyWords(cbxKeyWord.Text, testWord, testDoc, richTxbTestDoc, lbCountItems, rtbKeyWord); HandleWaitingForm.closeWaitingForm(wf); ifExecuted = true; preTestFileName = testFileName; /////查询关键字对应的标准规范值 string value = keyWord.getExistStandard(keyword); lbKeyWordSingle.Text = keyword; if (value != null) { lbKeyWordValueSingle.Text = value; } else { lbKeyWordValueSingle.Text = ""; } } } } else { keyWord.multiHightLigthKeyWord(preMultiTestFilePath, preMultiRegFilePath, preMultiSpecFilePath, multiTestFilePath, multiRegFilePath, multiSpecFilePath, keyword, testWord, rtbTestDoc, rtbRegDoc, rtbSpecificationDoc, null, null, null, rtxMultiTestDoc, rtbMultiRegDoc, rtbMultiSpecDoc, handleDocument, keywordChanged); updatePreFilePath(); /////查询关键字对应的标准规范值 string value = keyWord.getExistStandard(keyword); lbKeyWord.Text = keyword; if (value != null) { lbKeyWordValue.Text = value; } else { lbKeyWordValue.Text = "无标准数值信息"; } } } plTableTest.Hide(); plTOC.Hide(); if (!isMultiple) { plMultiInfo.Hide(); plKeyWord.Show(); } else { plKeyWord.Hide(); plMultiInfo.Show(); } keywordChanged = false; } else { MessageBox.Show("请输入关键字"); } }