コード例 #1
0
 /// <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);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: AutoCompleteTextBox.cs プロジェクト: bbriggs/wesay
		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;
		}