Наследование: DataNode, ICloneable, IComparable
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public object Clone()
        {
            ConfigurationNode ret = new ConfigurationNode();

            ret.m_Name = m_Name;
            m_Options.CopyTo(ret.m_Options);
            return(ret);
        }
Пример #2
0
 /// <summary>
 /// Gets the XML doc file.
 /// </summary>
 /// <param name="project">The project.</param>
 /// <param name="conf">The conf.</param>
 /// <returns></returns>
 public static string GenerateXmlDocFile(ProjectNode project, ConfigurationNode conf)
 {
     if( conf == null )
     {
         throw new ArgumentNullException("conf");
     }
     if( project == null )
     {
         throw new ArgumentNullException("project");
     }
     string docFile = (string)conf.Options["XmlDocFile"];
     if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
     {
         return "False";
     }
     return "True";
 }
Пример #3
0
 /// <summary>
 /// Gets the XML doc file.
 /// </summary>
 /// <param name="project">The project.</param>
 /// <param name="conf">The conf.</param>
 /// <returns></returns>
 public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf)
 {
     if( conf == null )
     {
         throw new ArgumentNullException("conf");
     }
     if( project == null )
     {
         throw new ArgumentNullException("project");
     }
     string docFile = (string)conf.Options["XmlDocFile"];
     //			if(docFile != null && docFile.Length == 0)//default to assembly name if not specified
     //			{
     //				return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml";
     //			}
     return docFile;
 }
Пример #4
0
 private void HandleConfiguration(ConfigurationNode conf)
 {
     if (String.Compare(conf.Name, "all", true) == 0)            //apply changes to all, this may not always be applied first,
     //so it *may* override changes to the same properties for configurations defines at the project level
     {
         foreach (ConfigurationNode confNode in m_Configurations.Values)
         {
             conf.CopyTo(confNode);                    //update the config templates defines at the project level with the overrides
         }
     }
     if (m_Configurations.ContainsKey(conf.NameAndPlatform))
     {
         ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform];
         conf.CopyTo(parentConf);                //update the config templates defines at the project level with the overrides
     }
     else
     {
         m_Configurations[conf.NameAndPlatform] = conf;
     }
 }
Пример #5
0
		private void HandleConfiguration(ConfigurationNode conf)
		{
			if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first,
				//so it *may* override changes to the same properties for configurations defines at the project level
			{
				foreach(ConfigurationNode confNode in m_Configurations.Values) 
				{
					conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides
				}
			}
			if(m_Configurations.ContainsKey(conf.NameAndPlatform))
			{
				ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform];
				conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides
			} 
			else
			{
				m_Configurations[conf.NameAndPlatform] = conf;
			}
		}
        public int CompareTo(object obj)
        {
            ConfigurationNode that = (ConfigurationNode)obj;

            return(this.m_Name.CompareTo(that.m_Name));
        }
 /// <summary>
 /// Copies to.
 /// </summary>
 /// <param name="conf">The conf.</param>
 public void CopyTo(ConfigurationNode conf)
 {
     m_Options.CopyTo(conf.m_Options);
 }
Пример #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();
            }
        }
Пример #9
0
        /// <summary>
        /// Gets the XML doc file.
        /// </summary>
        /// <param name="project">The project.</param>
        /// <param name="conf">The conf.</param>
        /// <returns></returns>
        public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf)
        {
            if( conf == null )
            {
                throw new ArgumentNullException("conf");
            }
            if( project == null )
            {
                throw new ArgumentNullException("project");
            }
            //			if(!(bool)conf.Options["GenerateXmlDocFile"]) //default to none, if the generate option is false
            //			{
            //				return string.Empty;
            //			}

            //default to "AssemblyName.xml"
            //string defaultValue = Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml";
            //return (string)conf.Options["XmlDocFile", defaultValue];

            //default to no XmlDocFile file
            return (string)conf.Options["XmlDocFile", ""];
        }
Пример #10
0
		/// <summary>
		/// Creates a new object that is a copy of the current instance.
		/// </summary>
		/// <returns>
		/// A new object that is a copy of this instance.
		/// </returns>
		public object Clone()
		{
			ConfigurationNode ret = new ConfigurationNode();
			ret.m_Name = m_Name;
			m_Options.CopyTo(ret.m_Options);
			return ret;
		}
Пример #11
0
		/// <summary>
		/// Copies to.
		/// </summary>
		/// <param name="conf">The conf.</param>
		public void CopyTo(ConfigurationNode conf)
		{
			m_Options.CopyTo(conf.m_Options);
		}
Пример #12
0
 private string ProjectOutput(ProjectNode project, ConfigurationNode config)
 {
     string filepath;
     filepath = Helper.MakeFilePath((string)config.Options["OutputPath"],
             project.AssemblyName, ProjectTypeToExtension(project.Type));
     return NicePath(project, filepath);
 }