Esempio n. 1
0
        /// <summary>
        /// Filter using a single filtering condition
        /// </summary>
        public static IEnumerable <T> FilterValues(IEnumerable <T> values, IFilterCondition <T> filterCondition)
        {
            List <T> filteredValues = new List <T>();

            foreach (var value in values)
            {
                if (filterCondition.Condition(value))
                {
                    filteredValues.Add(value);
                }
            }

            return(filteredValues);
        }
Esempio n. 2
0
        public static List <int> FilterValues(List <int> values, IFilterCondition filterCondition)
        {
            List <int> filteredValues = new List <int>();

            foreach (var value in values)
            {
                if (filterCondition.Condition(value))
                {
                    filteredValues.Add(value);
                }
            }

            return(filteredValues);
        }
Esempio n. 3
0
        public static ObservableCollection <Customer> FilterValues(ObservableCollection <Customer> customers,
                                                                   IFilterCondition ifc)
        {
            ObservableCollection <Customer> fileredValues = new ObservableCollection <Customer>();

            foreach (Customer costumer in customers)
            {
                if (ifc.Condition(costumer))
                {
                    fileredValues.Add(costumer);
                }
            }

            return(fileredValues);
        }