/// <summary> /// can be replaced by something smarter, using the FormToObjectFinderDelegate /// </summary> /// <param name="form"></param> private object DefaultFormToObjectFinder(string form) { foreach (object item in _items) { if (_itemDisplayAdaptor.GetDisplayLabel(item) == form) { return(item); } } return(null); }
private static IEnumerable FilterList(string text, IEnumerable items, IDisplayStringAdaptor adaptor) { ICollection <object> newList = new Collection <object>(); foreach (object item in items) { string label = adaptor.GetDisplayLabel(item); if (label.ToLower().StartsWith(text.ToLower())) { newList.Add(item); break; } } return(newList); }
private static IEnumerable FilterList(string text, IEnumerable items, IDisplayStringAdaptor adaptor) { ICollection<object> newList = new Collection<object>(); foreach (object item in items) { string label = adaptor.GetDisplayLabel(item); if (label.ToLower().StartsWith(text.ToLower())) { newList.Add(item); break; } } return newList; }