private static void DeepRemoveFilter(FilterElementCollection filterColl, FilterElement toRemoveFilter)
 {
     if (filterColl.Contains(toRemoveFilter))
     {
         filterColl.Remove(toRemoveFilter);
     }
     foreach (FilterElement filterEl in filterColl)
     {
         if (filterEl.HasChildElements)
         {
             DeepRemoveFilter(filterEl.ChildElements, toRemoveFilter);
         }
     }
 }
Example #2
0
 private static void DeepRemoveFilter(FilterElementCollection filterColl, FilterElement toRemoveFilter)
 {
     if (filterColl.Contains(toRemoveFilter))
     {
         filterColl.Remove(toRemoveFilter);
     }
     foreach (FilterElement filterEl in filterColl)
     {
         if (filterEl.HasChildElements)
         {
             DeepRemoveFilter(filterEl.ChildElements, toRemoveFilter);
         }
     }
 }