/// <summary>
 /// Adds a filter to the list of filters. If a filter already has been added, the new
 /// filter will be prefixed with the specified operator.
 /// </summary>
 /// <param name="filter">The filter to add.</param>
 /// <param name="op">The operator to use.</param>
 public AnalyticsFilterOptions Add(IAnalyticsFilter filter, AnalyticsFilterOperator op) {
     if (filter == null) throw new ArgumentNullException("filter");
     op = op ?? AnalyticsFilterOperator.Or;
     if (_filters.Any()) {
         if (_filters.Last() is AnalyticsFilterOperator) {
             _filters.RemoveAt(_filters.Count - 1);
         }
         _filters.Add(op);
     }
     _filters.Add(filter);
     return this;
 }
Example #2
0
 /// <summary>
 /// Adds a filter to the list of filters. If a filter already has been added, the new
 /// filter will be prefixed with the specified operator.
 /// </summary>
 /// <param name="filter">The filter to add.</param>
 /// <param name="op">The operator to use.</param>
 public AnalyticsFilterOptions Add(IAnalyticsFilter filter, AnalyticsFilterOperator op)
 {
     if (filter == null)
     {
         throw new ArgumentNullException("filter");
     }
     op = op ?? AnalyticsFilterOperator.Or;
     if (_filters.Any())
     {
         if (_filters.Last() is AnalyticsFilterOperator)
         {
             _filters.RemoveAt(_filters.Count - 1);
         }
         _filters.Add(op);
     }
     _filters.Add(filter);
     return(this);
 }