aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base
diff options
context:
space:
mode:
Diffstat (limited to 'Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base')
-rw-r--r--Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base93
1 files changed, 93 insertions, 0 deletions
diff --git a/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base
new file mode 100644
index 0000000..20095c3
--- /dev/null
+++ b/Prebuild/src/Core/Nodes/.svn/text-base/DatabaseProjectNode.cs.svn-base
@@ -0,0 +1,93 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Xml;
5
6using Prebuild.Core.Attributes;
7using Prebuild.Core.Interfaces;
8using Prebuild.Core.Utilities;
9
10namespace Prebuild.Core.Nodes
11{
12 [DataNode("DatabaseProject")]
13 public class DatabaseProjectNode : DataNode
14 {
15 string name;
16 string path;
17 string fullpath;
18 Guid guid = Guid.NewGuid();
19 readonly List<AuthorNode> authors = new List<AuthorNode>();
20 readonly List<DatabaseReferenceNode> references = new List<DatabaseReferenceNode>();
21
22 public Guid Guid
23 {
24 get { return guid; }
25 }
26
27 public string Name
28 {
29 get { return name; }
30 }
31
32 public string Path
33 {
34 get { return path; }
35 }
36
37 public string FullPath
38 {
39 get { return fullpath; }
40 }
41
42 public IEnumerable<DatabaseReferenceNode> References
43 {
44 get { return references; }
45 }
46
47 public override void Parse(XmlNode node)
48 {
49 name = Helper.AttributeValue(node, "name", name);
50 path = Helper.AttributeValue(node, "path", name);
51
52 try
53 {
54 fullpath = Helper.ResolvePath(path);
55 }
56 catch
57 {
58 throw new WarningException("Could not resolve Solution path: {0}", path);
59 }
60
61 Kernel.Instance.CurrentWorkingDirectory.Push();
62
63 try
64 {
65 Helper.SetCurrentDir(fullpath);
66
67 if (node == null)
68 {
69 throw new ArgumentNullException("node");
70 }
71
72 foreach (XmlNode child in node.ChildNodes)
73 {
74 IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
75
76 if (dataNode == null)
77 continue;
78
79 if (dataNode is AuthorNode)
80 authors.Add((AuthorNode)dataNode);
81 else if (dataNode is DatabaseReferenceNode)
82 references.Add((DatabaseReferenceNode)dataNode);
83 }
84 }
85 finally
86 {
87 Kernel.Instance.CurrentWorkingDirectory.Pop();
88 }
89
90 base.Parse(node);
91 }
92 }
93}