1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
18 using System
.Collections
;
23 private Folder parent
;
24 private DocumentNodeCollection documents
;
25 private FolderCollection folders
;
26 private ArrayList fragments
= new ArrayList();
27 private ArrayList breadCrumbs
= new ArrayList();
28 private DocumentNode navigationNode
;
30 public Folder(String name
)
33 documents
= new DocumentNodeCollection(this);
34 folders
= new FolderCollection(this);
37 public int NavigationLevel
41 if (navigationNode
!= null)
45 else if (parent
!= null)
47 return 1 + parent
.NavigationLevel
;
54 public DocumentNode NavigationNode
58 if (navigationNode
!= null)
60 return navigationNode
;
62 else if (parent
!= null)
64 return parent
.NavigationNode
;
69 set { navigationNode = value; }
72 public ArrayList BreadCrumbs
74 get { return breadCrumbs; }
83 return parent
.Path
+ "/" + name
;
100 get { return parent; }
101 set { parent = value; }
104 public ArrayList SectionFragments
106 get { return fragments; }
109 public DocumentNodeCollection Documents
111 get { return documents; }
114 public FolderCollection Folders
116 get { return folders; }
121 get { return 1 + (Parent != null ? Parent.Level : 0); }