From 549c615e0e7fbc4fa284de533db673e7e2fd665b Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 19 Feb 2009 14:54:21 +0000 Subject: * reverted the revert of the revert. What can I say? I'm calling this a day, and will get back up on the horse tomorrow. --- Prebuild/src/Core/Nodes/AuthorNode.cs | 9 ++ Prebuild/src/Core/Nodes/ConfigurationNode.cs | 9 ++ Prebuild/src/Core/Nodes/DataNode.cs | 59 ++------ Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | 94 ------------- Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | 63 --------- Prebuild/src/Core/Nodes/DescriptionNode.cs | 9 ++ Prebuild/src/Core/Nodes/ExcludeNode.cs | 9 ++ Prebuild/src/Core/Nodes/FileNode.cs | 42 +++--- Prebuild/src/Core/Nodes/FilesNode.cs | 14 +- Prebuild/src/Core/Nodes/MatchNode.cs | 51 ++++--- Prebuild/src/Core/Nodes/OptionsNode.cs | 11 ++ Prebuild/src/Core/Nodes/ProcessNode.cs | 9 ++ Prebuild/src/Core/Nodes/ProjectNode.cs | 169 ++++++++++------------- Prebuild/src/Core/Nodes/ReferenceNode.cs | 9 ++ Prebuild/src/Core/Nodes/ReferencePathNode.cs | 9 ++ Prebuild/src/Core/Nodes/SolutionNode.cs | 120 +++++----------- 16 files changed, 254 insertions(+), 432 deletions(-) delete mode 100644 Prebuild/src/Core/Nodes/DatabaseProjectNode.cs delete mode 100644 Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs (limited to 'Prebuild/src/Core/Nodes') diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs index 20e72c0..03ea934 100644 --- a/Prebuild/src/Core/Nodes/AuthorNode.cs +++ b/Prebuild/src/Core/Nodes/AuthorNode.cs @@ -23,6 +23,15 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O */ #endregion +#region CVS Information +/* + * $Source $ + * $Author: $ + * $Date: $ + * $Revision: $ + */ +#endregion + using System; using System.Collections; using System.Collections.Specialized; diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs index 67d78d5..828bff6 100644 --- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs +++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs @@ -23,6 +23,15 @@ 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-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $ + * $Revision: 71 $ + */ +#endregion + using System; using System.Xml; diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs index 763e6c3..60ed122 100644 --- a/Prebuild/src/Core/Nodes/DataNode.cs +++ b/Prebuild/src/Core/Nodes/DataNode.cs @@ -23,24 +23,31 @@ 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-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $ + * $Revision: 71 $ + */ +#endregion + using System; using System.Xml; using Prebuild.Core.Attributes; using Prebuild.Core.Interfaces; -using System.IO; namespace Prebuild.Core.Nodes { /// /// /// - public abstract class DataNode : IDataNode + public class DataNode : IDataNode { #region Fields private IDataNode parent; - string[] m_WebTypes = new string[] { "aspx", "ascx", "master", "ashx", "asmx" }; #endregion @@ -61,10 +68,7 @@ namespace Prebuild.Core.Nodes parent = value; } } - public string[] WebTypes - { - get { return m_WebTypes; } - } + /// /// Parses the specified node. /// @@ -72,46 +76,7 @@ namespace Prebuild.Core.Nodes public virtual void Parse(XmlNode node) { } - public BuildAction GetBuildActionByFileName(string fileName) - { - string extension = Path.GetExtension(fileName).ToLower(); - foreach (string type in WebTypes) - { - if (extension == type) - return BuildAction.Content; - } - return BuildAction.Compile; - } - /// - /// Parses the file type to figure out what type it is - /// - /// - public SubType GetSubTypeByFileName(string fileName) - { - string extension = System.IO.Path.GetExtension(fileName).ToLower(); - string designer = String.Format(".designer{0}", extension); - string path = fileName.ToLower(); - if (extension == ".resx") - { - return SubType.Designer; - } - else if (path.EndsWith(".settings")) - { - return SubType.Settings; - } - else - { - - foreach (string type in WebTypes) - { - if (path.EndsWith(string.Format("{0}{1}", type, extension))) - { - return SubType.CodeBehind; - } - } - } - return SubType.Code; - } + #endregion } } diff --git a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs deleted file mode 100644 index 8696a79..0000000 --- a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using System.Xml; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - [DataNode("DatabaseProject")] - public class DatabaseProjectNode : DataNode - { - string name; - string path; - string fullpath; - Guid guid = Guid.NewGuid(); - readonly List authors = new List(); - readonly List references = new List(); - - public Guid Guid - { - get { return guid; } - } - - public string Name - { - get { return name; } - } - - public string Path - { - get { return path; } - } - - public string FullPath - { - get { return fullpath; } - } - - public IEnumerable References - { - get { return references; } - } - - public override void Parse(XmlNode node) - { - name = Helper.AttributeValue(node, "name", name); - path = Helper.AttributeValue(node, "path", name); - - try - { - fullpath = Helper.ResolvePath(path); - } - catch - { - throw new WarningException("Could not resolve Solution path: {0}", path); - } - - Kernel.Instance.CurrentWorkingDirectory.Push(); - - try - { - Helper.SetCurrentDir(fullpath); - - if (node == null) - { - throw new ArgumentNullException("node"); - } - - foreach (XmlNode child in node.ChildNodes) - { - IDataNode dataNode = Kernel.Instance.ParseNode(child, this); - - if (dataNode == null) - continue; - - if (dataNode is AuthorNode) - authors.Add((AuthorNode)dataNode); - else if (dataNode is DatabaseReferenceNode) - references.Add((DatabaseReferenceNode)dataNode); - } - } - finally - { - Kernel.Instance.CurrentWorkingDirectory.Pop(); - } - - base.Parse(node); - } - } -} diff --git a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs b/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs deleted file mode 100644 index 97c3964..0000000 --- a/Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using Prebuild.Core.Attributes; -using Prebuild.Core.Utilities; - -namespace Prebuild.Core.Nodes -{ - [DataNode("DatabaseReference")] - public class DatabaseReferenceNode : DataNode - { - string name; - Guid providerId; - string connectionString; - - public string Name - { - get { return name; } - } - - public Guid ProviderId - { - get { return providerId; } - } - - public string ConnectionString - { - get { return connectionString; } - } - - public override void Parse(System.Xml.XmlNode node) - { - name = Helper.AttributeValue(node, "name", name); - - string providerName = Helper.AttributeValue(node, "providerName", string.Empty); - if (providerName != null) - { - switch (providerName) - { - // digitaljeebus: pulled from HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders\* - // Not sure if these will help other operating systems, or if there's a better way. - case "Microsoft.SqlServerCe.Client.3.5": - providerId = new Guid("7C602B5B-ACCB-4acd-9DC0-CA66388C1533"); break; - case "System.Data.OleDb": - providerId = new Guid("7F041D59-D76A-44ed-9AA2-FBF6B0548B80"); break; - case "System.Data.OracleClient": - providerId = new Guid("8F5C5018-AE09-42cf-B2CC-2CCCC7CFC2BB"); break; - case "System.Data.SqlClient": - providerId = new Guid("91510608-8809-4020-8897-FBA057E22D54"); break; - case "System.Data.Odbc": - providerId = new Guid("C3D4F4CE-2C48-4381-B4D6-34FA50C51C86"); break; - - default: - throw new ArgumentOutOfRangeException("providerName", providerName, "Could not provider name to an id."); - } - } - else - providerId = new Guid(Helper.AttributeValue(node, "providerId", Guid.Empty.ToString("B"))); - - connectionString = Helper.AttributeValue(node, "connectionString", connectionString); - - base.Parse(node); - } - } -} diff --git a/Prebuild/src/Core/Nodes/DescriptionNode.cs b/Prebuild/src/Core/Nodes/DescriptionNode.cs index 353a5ae..cff7afc 100644 --- a/Prebuild/src/Core/Nodes/DescriptionNode.cs +++ b/Prebuild/src/Core/Nodes/DescriptionNode.cs @@ -23,6 +23,15 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O */ #endregion +#region CVS Information +/* + * $Source $ + * $Author: $ + * $Date: $ + * $Revision: $ + */ +#endregion + using System; using System.Collections; using System.Collections.Specialized; diff --git a/Prebuild/src/Core/Nodes/ExcludeNode.cs b/Prebuild/src/Core/Nodes/ExcludeNode.cs index 7f04cba..afc869d 100644 --- a/Prebuild/src/Core/Nodes/ExcludeNode.cs +++ b/Prebuild/src/Core/Nodes/ExcludeNode.cs @@ -23,6 +23,15 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O */ #endregion +#region CVS Information +/* + * $Source$ + * $Author: borrillis $ + * $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $ + * $Revision: 243 $ + */ +#endregion + using System; using System.Xml; diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs index 1520fcb..083dba5 100644 --- a/Prebuild/src/Core/Nodes/FileNode.cs +++ b/Prebuild/src/Core/Nodes/FileNode.cs @@ -23,6 +23,15 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O */ #endregion +#region CVS Information +/* + * $Source$ + * $Author: borrillis $ + * $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $ + * $Revision: 243 $ + */ +#endregion + using System; using System.IO; using System.Xml; @@ -30,7 +39,6 @@ using System.Xml; using Prebuild.Core.Attributes; using Prebuild.Core.Interfaces; using Prebuild.Core.Utilities; -using Prebuild.Core.Targets; namespace Prebuild.Core.Nodes { @@ -85,11 +93,7 @@ namespace Prebuild.Core.Nodes /// /// /// - UserControl, - /// - /// - /// - CodeBehind, + UserControl } public enum CopyToOutput @@ -109,9 +113,9 @@ namespace Prebuild.Core.Nodes private string m_Path; private string m_ResourceName = ""; - private BuildAction? m_BuildAction; + private BuildAction m_BuildAction = BuildAction.Compile; private bool m_Valid; - private SubType? m_SubType; + private SubType m_SubType = SubType.Code; private CopyToOutput m_CopyToOutput = CopyToOutput.Never; private bool m_Link = false; private string m_LinkPath = string.Empty; @@ -151,11 +155,7 @@ namespace Prebuild.Core.Nodes { get { - if (m_BuildAction != null) - return m_BuildAction.Value; - else - return GetBuildActionByFileName(this.Path); - + return m_BuildAction; } } @@ -189,10 +189,7 @@ namespace Prebuild.Core.Nodes { get { - if (m_SubType != null) - return m_SubType.Value; - else - return GetSubTypeByFileName(this.Path); + return m_SubType; } } @@ -230,13 +227,10 @@ namespace Prebuild.Core.Nodes /// public override void Parse(XmlNode node) { - string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); - if (buildAction != string.Empty) - m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); - string subType = Helper.AttributeValue(node, "subType", string.Empty); - if (subType != String.Empty) - m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); - + m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), + Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString())); + m_SubType = (SubType)Enum.Parse(typeof(SubType), + Helper.AttributeValue(node, "subType", m_SubType.ToString())); m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); if ( this.m_Link == true ) diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs index dc306c2..7c1dd19 100644 --- a/Prebuild/src/Core/Nodes/FilesNode.cs +++ b/Prebuild/src/Core/Nodes/FilesNode.cs @@ -23,6 +23,15 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O */ #endregion +#region CVS Information +/* + * $Source$ + * $Author: borrillis $ + * $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $ + * $Revision: 243 $ + */ +#endregion + using System; using System.Collections; using System.Collections.Specialized; @@ -30,7 +39,6 @@ using System.Xml; using Prebuild.Core.Attributes; using Prebuild.Core.Interfaces; -using System.IO; namespace Prebuild.Core.Nodes { @@ -216,8 +224,8 @@ namespace Prebuild.Core.Nodes if (!m_Files.Contains(file)) { m_Files.Add(file); - m_BuildActions[ file ] = matchNode.BuildAction == null ? GetBuildActionByFileName(file) : matchNode.BuildAction; - m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; + m_BuildActions[ file ] = matchNode.BuildAction; + m_SubTypes[ file ] = matchNode.SubType; m_ResourceNames[ file ] = matchNode.ResourceName; this.m_PreservePaths[ file ] = matchNode.PreservePath; this.m_Links[ file ] = matchNode.IsLink; diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs index 656d7d0..aeaf3c1 100644 --- a/Prebuild/src/Core/Nodes/MatchNode.cs +++ b/Prebuild/src/Core/Nodes/MatchNode.cs @@ -23,8 +23,16 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O */ #endregion +#region CVS Information +/* + * $Source$ + * $Author: borrillis $ + * $Date: 2007-05-25 01:03:16 +0900 (Fri, 25 May 2007) $ + * $Revision: 243 $ + */ +#endregion + using System; -using System.Collections.Generic; using System.Collections.Specialized; using System.IO; using System.Text.RegularExpressions; @@ -45,16 +53,29 @@ namespace Prebuild.Core.Nodes { #region Fields - private readonly StringCollection m_Files = new StringCollection(); + private StringCollection m_Files; private Regex m_Regex; - private BuildAction? m_BuildAction; - private SubType? m_SubType; + private BuildAction m_BuildAction = BuildAction.Compile; + private SubType m_SubType = SubType.Code; string m_ResourceName = ""; private CopyToOutput m_CopyToOutput; private bool m_Link; private string m_LinkPath; private bool m_PreservePath; - private readonly List m_Exclusions = new List(); + private ArrayList m_Exclusions; + + #endregion + + #region Constructors + + /// + /// + /// + public MatchNode() + { + m_Files = new StringCollection(); + m_Exclusions = new ArrayList(); + } #endregion @@ -74,7 +95,7 @@ namespace Prebuild.Core.Nodes /// /// /// - public BuildAction? BuildAction + public BuildAction BuildAction { get { @@ -85,7 +106,7 @@ namespace Prebuild.Core.Nodes /// /// /// - public SubType? SubType + public SubType SubType { get { @@ -146,7 +167,7 @@ namespace Prebuild.Core.Nodes /// The pattern. /// if set to true [recurse]. /// if set to true [use regex]. - private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List exclusions) + private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, ArrayList exclusions) { Match match; Boolean excludeFile; @@ -258,14 +279,10 @@ namespace Prebuild.Core.Nodes string pattern = Helper.AttributeValue(node, "pattern", "*"); bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false")); bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false")); - string buildAction = Helper.AttributeValue(node, "buildAction", String.Empty); - if (buildAction != string.Empty) - m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction); - - //TODO: Figure out where the subtype node is being assigned - //string subType = Helper.AttributeValue(node, "subType", string.Empty); - //if (subType != String.Empty) - // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); + m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), + Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString())); + m_SubType = (SubType)Enum.Parse(typeof(SubType), + Helper.AttributeValue(node, "subType", m_SubType.ToString())); m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); @@ -312,7 +329,7 @@ namespace Prebuild.Core.Nodes if(dataNode is ExcludeNode) { ExcludeNode excludeNode = (ExcludeNode)dataNode; - m_Exclusions.Add( excludeNode ); + m_Exclusions.Add( dataNode ); } } diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs index b63034b..651c339 100644 --- a/Prebuild/src/Core/Nodes/OptionsNode.cs +++ b/Prebuild/src/Core/Nodes/OptionsNode.cs @@ -23,6 +23,17 @@ 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: 2007-01-09 01:55:40 +0900 (Tue, 09 Jan 2007) $ + * $Revision: 197 $ + */ +#endregion + + + using System; using System.Collections; using System.Collections.Specialized; diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs index 6bfbe16..2d2162c 100644 --- a/Prebuild/src/Core/Nodes/ProcessNode.cs +++ b/Prebuild/src/Core/Nodes/ProcessNode.cs @@ -23,6 +23,15 @@ 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-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $ + * $Revision: 71 $ + */ +#endregion + using System; using System.Collections; using System.Collections.Specialized; diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs index 0a24abf..e98ab5f 100644 --- a/Prebuild/src/Core/Nodes/ProjectNode.cs +++ b/Prebuild/src/Core/Nodes/ProjectNode.cs @@ -23,9 +23,17 @@ 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: 2007-05-26 06:58:26 +0900 (Sat, 26 May 2007) $ + * $Revision: 244 $ + */ +#endregion + using System; using System.Collections; -using System.Collections.Generic; using System.IO; using System.Xml; @@ -51,11 +59,7 @@ namespace Prebuild.Core.Nodes /// /// The project is a library /// - Library, - /// - /// The project is a website - /// - Web, + Library } /// @@ -72,25 +76,7 @@ namespace Prebuild.Core.Nodes /// Mono } - /// - /// The version of the .NET framework to use (Required for VS2008) - /// We don't need .NET 1.1 in here, it'll default when using vs2003. - /// - public enum FrameworkVersion - { - /// - /// .NET 2.0 - /// - v2_0, - /// - /// .NET 3.0 - /// - v3_0, - /// - /// .NET 3.5 - /// - v3_5, - } + /// /// The Node object representing /Prebuild/Solution/Project elements /// @@ -109,45 +95,49 @@ namespace Prebuild.Core.Nodes private string m_Language = "C#"; private ProjectType m_Type = ProjectType.Exe; private ClrRuntime m_Runtime = ClrRuntime.Microsoft; - private FrameworkVersion m_Framework = FrameworkVersion.v2_0; private string m_StartupObject = ""; private string m_RootNamespace; private string m_FilterGroups = ""; private string m_Version = ""; private Guid m_Guid; - private string m_DebugStartParameters; - private Hashtable m_Configurations = new Hashtable(); - private readonly List m_ReferencePaths = new List(); - private readonly List m_References = new List(); - private readonly List m_Authors = new List(); + private Hashtable m_Configurations; + private ArrayList m_ReferencePaths; + private ArrayList m_References; + private ArrayList m_Authors; private FilesNode m_Files; #endregion - #region Properties + #region Constructors /// - /// Gets the name. + /// Initializes a new instance of the class. /// - /// The name. - public string Name + public ProjectNode() { - get - { - return m_Name; - } + m_Configurations = new Hashtable(); + m_ReferencePaths = new ArrayList(); + m_References = new ArrayList(); + m_Authors = new ArrayList(); } + + #endregion + + #region Properties + /// - /// The version of the .NET Framework to compile under + /// Gets the name. /// - public FrameworkVersion FrameworkVersion + /// The name. + public string Name { get { - return this.m_Framework; + return m_Name; } } + /// /// Gets the path. /// @@ -220,17 +210,17 @@ namespace Prebuild.Core.Nodes } } - /// - /// Gets the app icon. - /// - /// The app icon. - public string ConfigFile - { - get - { - return m_ConfigFile; - } - } + /// + /// Gets the app icon. + /// + /// The app icon. + public string ConfigFile + { + get + { + return m_ConfigFile; + } + } /// /// @@ -279,22 +269,22 @@ namespace Prebuild.Core.Nodes } } - private bool m_GenerateAssemblyInfoFile = false; - - /// - /// - /// - public bool GenerateAssemblyInfoFile - { - get - { - return m_GenerateAssemblyInfoFile; - } - set - { - m_GenerateAssemblyInfoFile = value; - } - } + private bool m_GenerateAssemblyInfoFile = false; + + /// + /// + /// + public bool GenerateAssemblyInfoFile + { + get + { + return m_GenerateAssemblyInfoFile; + } + set + { + m_GenerateAssemblyInfoFile = value; + } + } /// /// Gets the startup object. @@ -324,7 +314,7 @@ namespace Prebuild.Core.Nodes /// Gets the configurations. /// /// The configurations. - public IList Configurations + public ICollection Configurations { get { @@ -350,11 +340,11 @@ namespace Prebuild.Core.Nodes /// Gets the reference paths. /// /// The reference paths. - public List ReferencePaths + public ArrayList ReferencePaths { get { - List tmp = new List(m_ReferencePaths); + ArrayList tmp = new ArrayList(m_ReferencePaths); tmp.Sort(); return tmp; } @@ -364,11 +354,11 @@ namespace Prebuild.Core.Nodes /// Gets the references. /// /// The references. - public List References + public ArrayList References { get { - List tmp = new List(m_References); + ArrayList tmp = new ArrayList(m_References); tmp.Sort(); return tmp; } @@ -378,7 +368,7 @@ namespace Prebuild.Core.Nodes /// Gets the Authors list. /// /// The list of the project's authors. - public List Authors + public ArrayList Authors { get { @@ -434,15 +424,7 @@ namespace Prebuild.Core.Nodes } } - public string DebugStartParameters - { - get - { - return m_DebugStartParameters; - } - } - - #endregion + #endregion #region Private Methods @@ -488,18 +470,13 @@ namespace Prebuild.Core.Nodes m_Language = Helper.AttributeValue(node, "language", m_Language); m_Type = (ProjectType)Helper.EnumAttributeValue(node, "type", typeof(ProjectType), m_Type); m_Runtime = (ClrRuntime)Helper.EnumAttributeValue(node, "runtime", typeof(ClrRuntime), m_Runtime); - m_Framework = (FrameworkVersion)Helper.EnumAttributeValue(node, "frameworkVersion", typeof(FrameworkVersion), m_Framework); m_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); - + m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); + int hash = m_Name.GetHashCode(); - Guid guidByHash = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - string guid = Helper.AttributeValue(node, "guid", guidByHash.ToString()); - m_Guid = new Guid(guid); + m_Guid = new Guid(hash, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); - m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); - if(m_AssemblyName == null || m_AssemblyName.Length < 1) { m_AssemblyName = m_Name; @@ -539,15 +516,15 @@ namespace Prebuild.Core.Nodes } else if(dataNode is ReferencePathNode) { - m_ReferencePaths.Add((ReferencePathNode)dataNode); + m_ReferencePaths.Add(dataNode); } else if(dataNode is ReferenceNode) { - m_References.Add((ReferenceNode)dataNode); + m_References.Add(dataNode); } else if(dataNode is AuthorNode) { - m_Authors.Add((AuthorNode)dataNode); + m_Authors.Add(dataNode); } else if(dataNode is FilesNode) { @@ -571,6 +548,6 @@ namespace Prebuild.Core.Nodes return this.m_Name.CompareTo(that.m_Name); } - #endregion + #endregion } } diff --git a/Prebuild/src/Core/Nodes/ReferenceNode.cs b/Prebuild/src/Core/Nodes/ReferenceNode.cs index 9c5d1a3..df0c2e4 100644 --- a/Prebuild/src/Core/Nodes/ReferenceNode.cs +++ b/Prebuild/src/Core/Nodes/ReferenceNode.cs @@ -23,6 +23,15 @@ 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-07-26 01:56:49 +0900 (Wed, 26 Jul 2006) $ + * $Revision: 132 $ + */ +#endregion + using System; using System.Xml; diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs index f0543c2..d4042ef 100644 --- a/Prebuild/src/Core/Nodes/ReferencePathNode.cs +++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs @@ -23,6 +23,15 @@ 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-01-28 09:49:58 +0900 (Sat, 28 Jan 2006) $ + * $Revision: 71 $ + */ +#endregion + using System; using System.Collections; using System.Collections.Specialized; diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs index 2a1b8e2..9473fe6 100644 --- a/Prebuild/src/Core/Nodes/SolutionNode.cs +++ b/Prebuild/src/Core/Nodes/SolutionNode.cs @@ -23,9 +23,17 @@ 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; @@ -40,62 +48,40 @@ 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 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(); + 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(); + } #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. /// @@ -209,36 +195,7 @@ 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. /// @@ -269,7 +226,7 @@ namespace Prebuild.Core.Nodes /// Gets the projects table. /// /// The projects table. - public List ProjectsTableOrder + public ArrayList ProjectsTableOrder { get { @@ -330,21 +287,8 @@ namespace Prebuild.Core.Nodes else if(dataNode is ProjectNode) { m_Projects[((ProjectNode)dataNode).Name] = dataNode; - m_ProjectsOrder.Add((ProjectNode)dataNode); + m_ProjectsOrder.Add(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