Renaming call to ResolveServices
[castle.git] / Experiments / AnakiaNet / Anakia / Folder.cs
blob66b4c7c4fd36836c974959b3084851a448bbcaa4
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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.
15 namespace Anakia
17 using System;
18 using System.Collections;
20 public class Folder
22 private String name;
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)
32 this.name = name;
33 documents = new DocumentNodeCollection(this);
34 folders = new FolderCollection(this);
37 public int NavigationLevel
39 get
41 if (navigationNode != null)
43 return 1;
45 else if (parent != null)
47 return 1 + parent.NavigationLevel;
50 return 0;
54 public DocumentNode NavigationNode
56 get
58 if (navigationNode != null)
60 return navigationNode;
62 else if (parent != null)
64 return parent.NavigationNode;
67 return null;
69 set { navigationNode = value; }
72 public ArrayList BreadCrumbs
74 get { return breadCrumbs; }
77 public string Path
79 get
81 if (parent != null)
83 return parent.Path + "/" + name;
85 else
87 return name;
92 public string Name
94 get { return name; }
95 set { name = value; }
98 public Folder Parent
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; }
119 public int Level
121 get { return 1 + (Parent != null ? Parent.Level : 0); }