/// <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> /// 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_Path = Helper.AttributeValue(node, "path", m_Path); m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); m_Version = Helper.AttributeValue(node, "version", m_Version); m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); 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); 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_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); if (string.IsNullOrEmpty(m_AssemblyName)) { m_AssemblyName = m_Name; } if (string.IsNullOrEmpty(m_RootNamespace)) { m_RootNamespace = m_Name; } 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 ConfigurationNode) { HandleConfiguration((ConfigurationNode)dataNode); } else if (dataNode is ReferencePathNode) { m_ReferencePaths.Add((ReferencePathNode)dataNode); } else if (dataNode is ReferenceNode) { m_References.Add((ReferenceNode)dataNode); } else if (dataNode is AuthorNode) { m_Authors.Add((AuthorNode)dataNode); } else if (dataNode is FilesNode) { m_Files = (FilesNode)dataNode; } } } finally { Kernel.Instance.CurrentWorkingDirectory.Pop(); } }
/// <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_Path = Helper.AttributeValue(node, "path", m_Path); m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); m_Version = Helper.AttributeValue(node, "version", m_Version); m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); m_ApplicationManifest = Helper.AttributeValue(node, "appmanifest", m_ApplicationManifest); m_ConfigFile = Helper.AttributeValue(node, "configFile", m_ConfigFile); m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); 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); if(m_useFramework) 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); 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_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); if(string.IsNullOrEmpty(m_AssemblyName)) { m_AssemblyName = m_Name; } if(string.IsNullOrEmpty(m_RootNamespace)) { m_RootNamespace = m_Name; } 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 ConfigurationNode) { HandleConfiguration((ConfigurationNode)dataNode); } else if(dataNode is ReferencePathNode) { m_ReferencePaths.Add((ReferencePathNode)dataNode); } else if(dataNode is ReferenceNode) { m_References.Add((ReferenceNode)dataNode); } else if(dataNode is AuthorNode) { m_Authors.Add((AuthorNode)dataNode); } else if(dataNode is FilesNode) { m_Files = (FilesNode)dataNode; } } } finally { Kernel.Instance.CurrentWorkingDirectory.Pop(); } }
/// <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(); } }
/// <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(); } }
private void WriteProject(StreamWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files) { if (!tools.ContainsKey(language)) throw new UnknownLanguageException("Unknown .NET language: " + language); ToolInfo toolInfo = (ToolInfo)tools[language]; writer.WriteLine(ProjectDeclarationBeginFormat, toolInfo.Guid, name, location, projectGuid.ToString("B").ToUpper()); if (files != null) { writer.WriteLine("\tProjectSection(SolutionItems) = preProject"); foreach (string file in files) writer.WriteLine("\t\t{0} = {0}", file); writer.WriteLine("\tEndProjectSection"); } writer.WriteLine(ProjectDeclarationEndFormat); }
/// <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_Path = Helper.AttributeValue(node, "path", m_Path); m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); m_DesignerFolder = Helper.AttributeValue(node, "designerFolder", m_DesignerFolder); m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); 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_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); int hash = m_Name.GetHashCode(); m_Guid = new Guid( hash, 0, 0, 0, 0, 0, 0,0,0,0,0 ); m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); if(m_AssemblyName == null || m_AssemblyName.Length < 1) { m_AssemblyName = m_Name; } if(m_RootNamespace == null || m_RootNamespace.Length < 1) { m_RootNamespace = m_Name; } 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 ConfigurationNode) { HandleConfiguration((ConfigurationNode)dataNode); } else if(dataNode is ReferencePathNode) { m_ReferencePaths.Add(dataNode); } else if(dataNode is ReferenceNode) { m_References.Add(dataNode); } else if(dataNode is FilesNode) { m_Files = (FilesNode)dataNode; } } } finally { Kernel.Instance.CurrentWorkingDirectory.Pop(); } }
/// <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(); } }
/// <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_Path = Helper.AttributeValue(node, "path", m_Path); m_FilterGroups = Helper.AttributeValue(node, "filterGroups", m_FilterGroups); m_AppIcon = Helper.AttributeValue(node, "icon", m_AppIcon); m_AssemblyName = Helper.AttributeValue(node, "assemblyName", m_AssemblyName); 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_StartupObject = Helper.AttributeValue(node, "startupObject", m_StartupObject); m_RootNamespace = Helper.AttributeValue(node, "rootNamespace", m_RootNamespace); m_Guid = Guid.NewGuid(); if (m_AssemblyName == null || m_AssemblyName.Length < 1) { m_AssemblyName = m_Name; } if (m_RootNamespace == null || m_RootNamespace.Length < 1) { m_RootNamespace = m_Name; } 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 ConfigurationNode) { HandleConfiguration((ConfigurationNode)dataNode); } else if (dataNode is ReferencePathNode) { m_ReferencePaths.Add(dataNode); } else if (dataNode is ReferenceNode) { m_References.Add(dataNode); } else if (dataNode is FilesNode) { m_Files = (FilesNode)dataNode; } } } finally { Kernel.Instance.CurrentWorkingDirectory.Pop(); } }