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