From 40d88ce9057babd28074afe803086bf415527dca Mon Sep 17 00:00:00 2001
From: lbsa71
Date: Thu, 19 Feb 2009 14:35:11 +0000
Subject: * Reverted the revert, as it seems the problem was the 1.0.* in the
separate projects.
---
Prebuild/src/Core/Nodes/SolutionNode.cs | 120 +++++++++++++++++++++++---------
1 file changed, 88 insertions(+), 32 deletions(-)
(limited to 'Prebuild/src/Core/Nodes/SolutionNode.cs')
diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs
index 9473fe6..2a1b8e2 100644
--- a/Prebuild/src/Core/Nodes/SolutionNode.cs
+++ b/Prebuild/src/Core/Nodes/SolutionNode.cs
@@ -23,17 +23,9 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
*/
#endregion
-#region CVS Information
-/*
- * $Source$
- * $Author: jendave $
- * $Date: 2006-03-01 01:15:42 +0900 (Wed, 01 Mar 2006) $
- * $Revision: 92 $
- */
-#endregion
-
using System;
using System.Collections;
+using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Xml;
@@ -48,40 +40,62 @@ namespace Prebuild.Core.Nodes
///
///
[DataNode("Solution")]
+ [DataNode("EmbeddedSolution")]
+ [DebuggerDisplay("{Name}")]
public class SolutionNode : DataNode
{
#region Fields
-
+
+ private Guid m_Guid = Guid.NewGuid();
private string m_Name = "unknown";
private string m_Path = "";
private string m_FullPath = "";
private string m_ActiveConfig = "Debug";
private string m_Version = "1.0.0";
-
+
private OptionsNode m_Options;
private FilesNode m_Files;
- private Hashtable m_Configurations;
- private Hashtable m_Projects;
- private ArrayList m_ProjectsOrder;
-
- #endregion
-
- #region Constructors
-
- ///
- /// Initializes a new instance of the class.
- ///
- public SolutionNode()
- {
- m_Configurations = new Hashtable();
- m_Projects = new Hashtable();
- m_ProjectsOrder = new ArrayList();
- }
+ private readonly Hashtable m_Configurations = new Hashtable();
+ private readonly Hashtable m_Projects = new Hashtable();
+ private readonly Hashtable m_DatabaseProjects = new Hashtable();
+ private readonly List m_ProjectsOrder = new List();
+ private readonly Hashtable m_Solutions = new Hashtable();
#endregion
#region Properties
-
+ public override IDataNode Parent
+ {
+ get
+ {
+ return base.Parent;
+ }
+ set
+ {
+ if (value is SolutionNode)
+ {
+ SolutionNode solution = (SolutionNode)value;
+ foreach (ConfigurationNode conf in solution.Configurations)
+ {
+ m_Configurations[conf.Name] = conf.Clone();
+ }
+ }
+
+ base.Parent = value;
+ }
+ }
+
+ public Guid Guid
+ {
+ get
+ {
+ return m_Guid;
+ }
+ set
+ {
+ m_Guid = value;
+ }
+ }
///
/// Gets or sets the active config.
///
@@ -195,7 +209,36 @@ namespace Prebuild.Core.Nodes
return m_Configurations;
}
}
-
+ ///
+ /// Gets the database projects.
+ ///
+ public ICollection DatabaseProjects
+ {
+ get
+ {
+ return m_DatabaseProjects.Values;
+ }
+ }
+ ///
+ /// Gets the nested solutions.
+ ///
+ public ICollection Solutions
+ {
+ get
+ {
+ return m_Solutions.Values;
+ }
+ }
+ ///
+ /// Gets the nested solutions hash table.
+ ///
+ public Hashtable SolutionsTable
+ {
+ get
+ {
+ return this.m_Solutions;
+ }
+ }
///
/// Gets the projects.
///
@@ -226,7 +269,7 @@ namespace Prebuild.Core.Nodes
/// Gets the projects table.
///
/// The projects table.
- public ArrayList ProjectsTableOrder
+ public List ProjectsTableOrder
{
get
{
@@ -287,8 +330,21 @@ namespace Prebuild.Core.Nodes
else if(dataNode is ProjectNode)
{
m_Projects[((ProjectNode)dataNode).Name] = dataNode;
- m_ProjectsOrder.Add(dataNode);
+ m_ProjectsOrder.Add((ProjectNode)dataNode);
}
+ else if(dataNode is SolutionNode)
+ {
+ m_Solutions[((SolutionNode)dataNode).Name] = dataNode;
+ }
+ else if (dataNode is ProcessNode)
+ {
+ ProcessNode p = (ProcessNode)dataNode;
+ Kernel.Instance.ProcessFile(p, this);
+ }
+ else if (dataNode is DatabaseProjectNode)
+ {
+ m_DatabaseProjects[((DatabaseProjectNode)dataNode).Name] = dataNode;
+ }
}
}
finally
--
cgit v1.1