Inheritance: DataNode
Example #1
0
        /// <summary>
        /// Parses the specified node.
        /// </summary>
        /// <param name="node">The node.</param>
        public override void Parse(XmlNode node)
        {
            m_Name         = Helper.AttributeValue(node, "name", m_Name);
            m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig);
            m_Path         = Helper.AttributeValue(node, "path", m_Path);

            m_FullPath = m_Path;
            try
            {
                m_FullPath = Helper.ResolvePath(m_FullPath);
            }
            catch
            {
                throw new WarningException("Could not resolve solution path: {0}", m_Path);
            }

            Kernel.Instance.CurrentWorkingDirectory.Push();
            try
            {
                Helper.SetCurrentDir(m_FullPath);

                if (node == null)
                {
                    throw new ArgumentNullException("node");
                }

                foreach (XmlNode child in node.ChildNodes)
                {
                    IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
                    if (dataNode is OptionsNode)
                    {
                        m_Options = (OptionsNode)dataNode;
                    }
                    else if (dataNode is FilesNode)
                    {
                        m_Files = (FilesNode)dataNode;
                    }
                    else if (dataNode is ConfigurationNode)
                    {
                        m_Configurations[((ConfigurationNode)dataNode).Name] = dataNode;
                    }
                    else if (dataNode is ProjectNode)
                    {
                        m_Projects[((ProjectNode)dataNode).Name] = dataNode;
                        m_ProjectsOrder.Add(dataNode);
                    }
                }
            }
            finally
            {
                Kernel.Instance.CurrentWorkingDirectory.Pop();
            }
        }
        /// <summary>
        /// Copies to.
        /// </summary>
        /// <param name="opt">The opt.</param>
        public void CopyTo(OptionsNode opt)
        {
            if (opt == null)
            {
                return;
            }

            foreach (FieldInfo f in m_OptionFields.Values)
            {
                if (m_FieldsDefined.Contains(f.Name))
                {
                    f.SetValue(opt, f.GetValue(this));
                    opt.m_FieldsDefined.Add(f.Name);
                }
            }
        }
Example #3
0
		/// <summary>
		/// Copies to.
		/// </summary>
		/// <param name="opt">The opt.</param>
		public void CopyTo(OptionsNode opt)
		{
			if(opt == null)
			{
				return;
			}

			foreach(FieldInfo f in m_OptionFields.Values)
			{
				if(m_FieldsDefined.Contains(f.Name))
				{
					f.SetValue(opt, f.GetValue(this));
					opt.m_FieldsDefined.Add(f.Name);
				}
			}
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="ConfigurationNode"/> class.
 /// </summary>
 public ConfigurationNode()
 {
     m_Options = new OptionsNode();
 }
Example #5
0
        /// <summary>
        /// Parses the specified node.
        /// </summary>
        /// <param name="node">The node.</param>
        public override void Parse(XmlNode node)
        {
            m_Name         = Helper.AttributeValue(node, "name", m_Name);
            m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig);
            m_Path         = Helper.AttributeValue(node, "path", m_Path);
            m_Version      = Helper.AttributeValue(node, "version", m_Version);

            m_FullPath = m_Path;
            try
            {
                m_FullPath = Helper.ResolvePath(m_FullPath);
            }
            catch
            {
                throw new WarningException("Could not resolve solution path: {0}", m_Path);
            }

            Kernel.Instance.CurrentWorkingDirectory.Push();
            try
            {
                Helper.SetCurrentDir(m_FullPath);

                if (node == null)
                {
                    throw new ArgumentNullException("node");
                }

                foreach (XmlNode child in node.ChildNodes)
                {
                    IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
                    if (dataNode is OptionsNode)
                    {
                        m_Options = (OptionsNode)dataNode;
                    }
                    else if (dataNode is FilesNode)
                    {
                        m_Files = (FilesNode)dataNode;
                    }
                    else if (dataNode is ConfigurationNode)
                    {
                        ConfigurationNode configurationNode = (ConfigurationNode)dataNode;
                        m_Configurations[configurationNode.NameAndPlatform] = configurationNode;

                        // If the active configuration is null, then we populate it.
                        if (ActiveConfig == null)
                        {
                            ActiveConfig = configurationNode.Name;
                        }
                    }
                    else if (dataNode is ProjectNode)
                    {
                        m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode)dataNode;
                        m_ProjectsOrder.Add((ProjectNode)dataNode);
                    }
                    else if (dataNode is SolutionNode)
                    {
                        m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode)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] = (DatabaseProjectNode)dataNode;
                    }
                    else if (dataNode is CleanupNode)
                    {
                        if (m_Cleanup != null)
                        {
                            throw new WarningException("There can only be one Cleanup node.");
                        }
                        m_Cleanup = (CleanupNode)dataNode;
                    }
                }
            }
            finally
            {
                Kernel.Instance.CurrentWorkingDirectory.Pop();
            }
        }
Example #6
0
		/// <summary>
		/// Initializes a new instance of the <see cref="ConfigurationNode"/> class.
		/// </summary>
		public ConfigurationNode()
		{
			m_Options = new OptionsNode();
		}
Example #7
0
		/// <summary>
		/// Parses the specified node.
		/// </summary>
		/// <param name="node">The node.</param>
		public override void Parse(XmlNode node)
		{
			m_Name = Helper.AttributeValue(node, "name", m_Name);
			m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig);
			m_Path = Helper.AttributeValue(node, "path", m_Path);

			m_FullPath = m_Path;
			try
			{
				m_FullPath = Helper.ResolvePath(m_FullPath);
			}
			catch
			{
				throw new WarningException("Could not resolve solution path: {0}", m_Path);
			}

			Kernel.Instance.CurrentWorkingDirectory.Push();
			try
			{
				Helper.SetCurrentDir(m_FullPath);

				if( node == null )
				{
					throw new ArgumentNullException("node");
				}

				foreach(XmlNode child in node.ChildNodes)
				{
					IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
					if(dataNode is OptionsNode)
					{
						m_Options = (OptionsNode)dataNode;
					}
					else if(dataNode is FilesNode)
					{
						m_Files = (FilesNode)dataNode;
					}
					else if(dataNode is ConfigurationNode)
					{
						m_Configurations[((ConfigurationNode)dataNode).Name] = dataNode;
					}
					else if(dataNode is ProjectNode)
					{
						m_Projects[((ProjectNode)dataNode).Name] = 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
			{
				Kernel.Instance.CurrentWorkingDirectory.Pop();
			}
		}
Example #8
0
		/// <summary>
		/// Parses the specified node.
		/// </summary>
		/// <param name="node">The node.</param>
		public override void Parse(XmlNode node)
		{
			m_Name = Helper.AttributeValue(node, "name", m_Name);
			m_ActiveConfig = Helper.AttributeValue(node, "activeConfig", m_ActiveConfig);
			m_Path = Helper.AttributeValue(node, "path", m_Path);
			m_Version = Helper.AttributeValue(node, "version", m_Version);

			m_FullPath = m_Path;
			try
			{
				m_FullPath = Helper.ResolvePath(m_FullPath);
			}
			catch
			{
				throw new WarningException("Could not resolve solution path: {0}", m_Path);
			}

			Kernel.Instance.CurrentWorkingDirectory.Push();
			try
			{
				Helper.SetCurrentDir(m_FullPath);

				if( node == null )
				{
					throw new ArgumentNullException("node");
				}

				foreach(XmlNode child in node.ChildNodes)
				{
					IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
					if(dataNode is OptionsNode)
					{
						m_Options = (OptionsNode)dataNode;
					}
					else if(dataNode is FilesNode)
					{
						m_Files = (FilesNode)dataNode;
					}
					else if(dataNode is ConfigurationNode)
					{
						ConfigurationNode configurationNode = (ConfigurationNode) dataNode;
						m_Configurations[configurationNode.NameAndPlatform] = configurationNode;

						// If the active configuration is null, then we populate it.
						if (ActiveConfig == null)
						{
							ActiveConfig = configurationNode.Name;
						}
					}
					else if(dataNode is ProjectNode)
					{
						m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode;
						m_ProjectsOrder.Add((ProjectNode)dataNode);
					}
                    else if(dataNode is SolutionNode)
                    {
                        m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) 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] = (DatabaseProjectNode) dataNode;
                    }
                    else if(dataNode is CleanupNode)
                    {
                        if(m_Cleanup != null)
                            throw new WarningException("There can only be one Cleanup node.");
                        m_Cleanup = (CleanupNode)dataNode;
                    }
				}
			}
			finally
			{
				Kernel.Instance.CurrentWorkingDirectory.Pop();
			}
		}