public void FindPrevious() { if (SearchedItems != null && SearchedItems.Count > 0) { if (matchindex - 1 < SearchedItems.Count && matchindex != 0) { ApplyInline(SearchedItems[matchindex], false); ApplyInline(SearchedItems[matchindex - 1], true); Treeview.BringIntoView(SearchedItems[matchindex - 1]); matchindex--; } else { ApplyInline(SearchedItems[matchindex], false); matchindex = SearchedItems.Count - 1; ApplyInline(SearchedItems[matchindex], true); Treeview.BringIntoView(SearchedItems[matchindex]); } } }
public void FindNext() { if (SearchedItems != null && SearchedItems.Count > 0) { ApplyInline(SearchedItems[matchindex], false); if (matchindex + 1 < SearchedItems.Count) { ApplyInline(SearchedItems[matchindex + 1], true); Treeview.BringIntoView(SearchedItems[matchindex + 1]); matchindex++; } else { ApplyInline(SearchedItems[matchindex], false); matchindex = 0; ApplyInline(SearchedItems[0], true); Treeview.BringIntoView(SearchedItems[0]); } } }