/// <summary> /// Reset the list of matching items. /// </summary> /// <param name="searchKey"></param> protected override void ResetMatches(string searchKey) { Cursor = Cursors.WaitCursor; try { if (m_oldSearchKey == searchKey) { return; // Nothing new to do, so skip it. } else { btnOK.Enabled = false; // disable Go button until we rebuild our match list. } m_oldSearchKey = searchKey; List <ExtantWfiWordformInfo> matches = ExtantWfiWordformInfo.ExtantWordformInfo(m_cache, searchKey, StringUtils.GetWsAtOffset(m_tbForm.Tss, 0)); this.matchingEntries.SuspendLayout(); List <int> rghvo = new List <int>(matches.Count); foreach (ExtantWfiWordformInfo match in matches) { bool isFiltered = false; foreach (ExtantWfiWordformInfo ewi in m_filteredEntries) { if (match.ID == ewi.ID) { isFiltered = true; break; } } if (!isFiltered) { rghvo.Add(match.ID); } } (Clerk as MatchingItemsRecordClerk).UpdateList(rghvo.ToArray()); this.matchingEntries.ResumeLayout(true); if (rghvo.Count == 0) { (this.matchingEntries as BrowseViewer).SelectedIndex = -1; m_selEntryID = 0; } else { (this.matchingEntries as BrowseViewer).SelectedIndex = Clerk.CurrentIndex; m_selEntryID = Clerk.CurrentObject.Hvo; //RaiseSelectionChanged(); //RaiseRestoreFocus(); } this.matchingEntries.TabStop = rghvo.Count > 0; btnOK.Enabled = (m_selEntryID > 0); } finally { matchingEntries_RestoreFocus(null, null); Cursor = Cursors.Default; } }
public void SetDlgInfo(Mediator mediator, WindowParams wp, List <IWfiWordform> filteredEntries) { CheckDisposed(); Debug.Assert(filteredEntries != null && filteredEntries.Count > 0); foreach (IWfiWordform ww in filteredEntries) { if (ww != null) // assignment of ww.Hvo will crash: LT-4951 { ExtantWfiWordformInfo ewi = new ExtantWfiWordformInfo(); ewi.ID = ww.Hvo; m_filteredEntries.Add(ewi); } } base.SetDlgInfo((FdoCache)mediator.PropertyTable.GetValue("cache"), wp, mediator); }