Refactored the Kernel registration fluent interface to be more readable, better suppo...
[castle.git] / Experiments / AnakiaNet / Anakia / DocumentNode.cs
bloba480eedd9f96340bed4cbb5e33af007704f271bc
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;
19 using System.Xml;
21 public enum NodeType
23 Index,
24 Navigation,
25 Ordinary
28 public class DocumentNode
30 private NodeType nodeType;
31 private String fileName;
32 private String path;
33 private DocumentMeta meta;
34 private XmlDocument xmldoc;
35 private Folder parentFolder;
36 private ArrayList breadCrumbs = new ArrayList();
38 public DocumentNode(String path, String fileName, XmlDocument doc, DocumentMeta meta)
40 this.path = path;
41 this.fileName = fileName;
42 this.meta = meta;
44 xmldoc = doc;
46 if (fileName.ToLower() == "navigation.xml")
48 nodeType = NodeType.Navigation;
50 else if (fileName.ToLower() == "index.xml")
52 nodeType = NodeType.Index;
54 else
56 nodeType = NodeType.Ordinary;
60 public Folder ParentFolder
62 get { return parentFolder; }
63 set { parentFolder = value; }
66 public NodeType NodeType
68 get { return nodeType; }
71 public string Filename
73 get { return fileName; }
76 public string TargetFilename
78 get { return System.IO.Path.GetFileNameWithoutExtension(fileName) + ".html"; }
81 public string Path
83 get { return path; }
86 public XmlDocument XmlDoc
88 get { return xmldoc; }
91 public ArrayList BreadCrumbs
93 get { return breadCrumbs; }
96 public DocumentMeta Meta
98 get { return meta; }
99 set { meta = value; }