Go to the documentation of this file.00001 using System.Collections.Generic;
00002 using N2.Engine;
00003 using System;
00004 namespace N2.Collections
00005 {
00009 public abstract class HierarchyBuilder
00010 {
00011 ChildFactoryDelegate getChildren = (item) => item.GetChildren();
00012
00013 public ChildFactoryDelegate GetChildren
00014 {
00015 get { return getChildren; }
00016 set { getChildren = value; }
00017 }
00018
00023 [Obsolete("Use GetChilren delegate instead", true)]
00024 public ItemFilter[] Filters
00025 {
00026 get { throw new NotSupportedException("Getting filters is no longer supported"); }
00027 set { Children(value); }
00028 }
00029
00034 public abstract HierarchyNode<ContentItem> Build();
00035
00039 [Obsolete("Use builder.Children(ChildFactoryDelegate).Build()", true)]
00040 public HierarchyNode<ContentItem> Build(params ItemFilter[] filters)
00041 {
00042 return Children(filters).Build();
00043 }
00044
00048 public HierarchyBuilder Children(params ItemFilter[] filters)
00049 {
00050 GetChildren = (item) => item.GetChildren(filters);
00051 return this;
00052 }
00053
00057 public HierarchyBuilder Children(ChildFactoryDelegate childFactory)
00058 {
00059 GetChildren = childFactory;
00060 return this;
00061 }
00062 }
00063 }