// ******************************************************************************** /// <summary> /// /// </summary> /// <param name="requestid"></param> /// <param name="items"></param> /// <returns></returns> /// <created>UPh,31.10.2015</created> /// <changed>UPh,31.10.2015</changed> // ******************************************************************************** internal void FireTermInfoResult(long requestid, int termbaseID, TermInfo info) { if (TermListResult == null) { return; } TermInfoResultArgs args = new TermInfoResultArgs(); args.RequestID = requestid; args.TermBaseID = termbaseID; args.Info = info; TermInfoResult(this, args); }
// ******************************************************************************** /// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <returns></returns> /// <created>UPh,17.11.2015</created> /// <changed>UPh,17.11.2015</changed> // ******************************************************************************** private void cmbMatches_SelectedIndexChanged(object sender, EventArgs e) { int inx = cmbMatches.SelectedIndex; if (inx < 0 || inx >= _Result.Count) { return; } TermInfoResultArgs item = _Result[inx]; string name = _TermbaseSet.GetDisplayName(item.TermBaseID); termInfoControl.SetData(name, item.Info); }
// ******************************************************************************** /// <summary> /// /// </summary> /// <param name="term"></param> /// <param name="infos"></param> /// <returns></returns> /// <created>UPh,17.11.2015</created> /// <changed>UPh,17.11.2015</changed> // ******************************************************************************** internal void HandleTermInfosRequest(string term, List <TermInfoResultArgs> result = null) { bool bSync = (result != null); // Build index if necessary if (_Index.LCID != _TermbaseQuery.LCID1) { TermListItems items = RetrieveTermList(true, false); if (!bSync && _shouldStop) { return; } // Index from items _Index.BuildIndex(_TermbaseQuery.LCID1, items); } foreach (IndexItem match in _Index.Matches(term)) { // Get TermInfo TermBase termbase = _TermBases.FindTermBase(match.TermBaseID); if (termbase == null) { continue; } TermInfo terminfo = null; if (!termbase.GetTermInfo(match.TermID, out terminfo, this)) { return; } TermInfoResultArgs item = new TermInfoResultArgs(); item.RequestID = 0; item.TermBaseID = match.TermBaseID; item.Info = terminfo; result.Add(item); } }