System.Windows.Data.ListCollectionView.AddToFiltered C# (CSharp) 메소드

AddToFiltered() 개인적인 메소드

private AddToFiltered ( object item, bool sorted ) : bool
item object
sorted bool
리턴 bool
		bool AddToFiltered (object item, bool sorted)
		{
			// If we are not adding a new item and we have a filter, see if the item passes the filter
			if (CurrentAddItem == null && Filter != null)
				if (!Filter (item))
					return false;

			// Only do a sorted insert if we are not adding a new item
			if (CurrentAddItem == null && sorted && SortDescriptions.Count > 0) {
				int index = filteredList.BinarySearch (item, new PropertyComparer (SortDescriptions));
				if (index < 0)
					index = ~index;
				filteredList.Insert (index, item);
			} else {
				filteredList.Add (item);
			}
			return true;
		}