protected void filter(IBindingListView source, StringSearchMatcher search) { if (propname == null || search.TextLength == 0) { source.RemoveFilter(); if (propname == null) TextBox.Clear(); } else source.Filter = propname + " like " + (AlwaysSearchInnerText ? "*" : null) + Text + "*"; var p = GetCurrentPosition(); if (p.X != pos.X && pos.X != -1 && RecordCount > 0 && p.Y != -1) { SetPosition(pos.X, p.Y); } }
protected virtual bool search(StringSearchMatcher search) { object pos = GetPosition(); for (; ; ) { var val = GetCurrent(); if (val != null && search.Matches(val.ToString())) { SetFoundPosition(); return true; } if (!IncreasePosition()) break; } ResetStartPosition(pos); return false; }
protected abstract void filter(StringSearchMatcher search);
public SearchBoxBase() { searchmatcher = new StringSearchMatcher(GetDefaultMode()); InitializeComponent(); }
protected override void filter(StringSearchMatcher search) { filter(BindingListView, search); }
protected override void filter(StringSearchMatcher search) { throw new NotImplementedException(); }
protected override bool search(StringSearchMatcher search) { if (needsetprops) setprops(); return base.search(search); }