Пример #1
0
 public void ApplyFilters(FilterSet filters)
 {
     for (int i = Results.Count - 1; i >= 0; i--)
     {
         // if Flight is invalid or fails Filters then remove from result set
         if ((!Results[i].IsValid()) || (!filters.PassesFilters(Results[i])))
         {
             Results.RemoveAt(i);
         }
     }
 }
Пример #2
0
        public FilterBuilder()
        {
            DefaultFilters = new Dictionary <string, FilterSet>();

            // Setup basic default filter with check departure time is in the future
            // and total ground time is less than 2 hours (120 mins)
            var basicFilters = new FilterSet();

            basicFilters.AddFilter(new FilterFlightFutureDeparture());
            basicFilters.AddFilter(new FilterFlightMaximumGroundTime(120));

            DefaultFilters.Add("Basic", basicFilters);
        }