Go to the documentation of this file.00001 using System;
00002 using N2.Engine;
00003
00004 namespace N2.Collections
00005 {
00009 public class DelegateFilter : ItemFilter
00010 {
00011 readonly Func<ContentItem, bool> isPositiveMatch;
00012
00013 public DelegateFilter(Func<ContentItem, bool> isPositiveMatch)
00014 {
00015 if (isPositiveMatch == null) throw new ArgumentNullException("isPositiveMatch");
00016
00017 this.isPositiveMatch = isPositiveMatch;
00018 }
00019
00020 public override bool Match(ContentItem item)
00021 {
00022 return isPositiveMatch(item);
00023 }
00024 }
00025 }