/// <summary> /// Creates the template data node. /// </summary> /// <returns></returns> internal XmlNode CreateTemplateDataNode() { const string TEMPLATEDATA_NODE = "TemplateData"; const string NAME_ATT = "Name"; const string DESCRIPTION_ATT = "Description"; const string PROJECTTYPE_ATT = "ProjectType"; const string SORTORDER_ATT = "SortOrder"; const string CREATENEWFOLDER_ATT = "CreateNewFolder"; const string DEFAULTNAME_ATT_NAME = "DefaultName"; const string PROVIDEDEFAULTNAME_ATT = "ProvideDefaultName"; const string ICON_ATT = "Icon"; XmlNode templateDataNode = vsTemplate.CreateElement(TEMPLATEDATA_NODE); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, NAME_ATT, this.Name)); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, DESCRIPTION_ATT, this.Description)); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, PROJECTTYPE_ATT, this.ProjectType.ToString())); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, SORTORDER_ATT, this.SortOrder.ToString(NumberFormatInfo.InvariantInfo))); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, ICON_ATT, this.Icon)); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, CREATENEWFOLDER_ATT, this.CreateNewFolder.ToString().ToLowerInvariant())); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, DEFAULTNAME_ATT_NAME, this.DefaultName)); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, PROVIDEDEFAULTNAME_ATT, this.ProvideDefaultName.ToString().ToLowerInvariant())); return(templateDataNode); }
/// <summary> /// Creates the template content node. /// </summary> /// <returns></returns> internal XmlNode CreateTemplateContentNode() { const string TEMPLATECONTENT_NODE = "TemplateContent"; XmlNode templateContent = VSTemplateExporterHelper.CreateNode(vsTemplate, TEMPLATECONTENT_NODE); return(templateContent); }
/// <summary> /// Creates the projec collectiont node. /// </summary> /// <returns></returns> internal XmlNode CreateProjecCollectiontNode() { const string PROJECTCOLLECTION_NODE = "ProjectCollection"; XmlNode projectCollection = VSTemplateExporterHelper.CreateNode(vsTemplate, PROJECTCOLLECTION_NODE); return(projectCollection); }
/// <summary> /// Creates the project template link node. /// </summary> /// <param name="projectName">Name of the project.</param> /// <param name="relativeTemplatePath">The relative template path.</param> /// <returns></returns> internal XmlNode CreateProjectTemplateLinkNode(string projectName, string relativeTemplatePath) { const string PROJECTTEMPLATELINK_NODE = "ProjectTemplateLink"; const string PROJECTNAME_ATT = "ProjectName"; XmlNode projectTemplateLinkNode = VSTemplateExporterHelper.CreateNode(vsTemplate, PROJECTTEMPLATELINK_NODE, relativeTemplatePath); projectTemplateLinkNode.Attributes.Append(VSTemplateExporterHelper.CreateAttribute(vsTemplate, PROJECTNAME_ATT, projectName)); return(projectTemplateLinkNode); }
/// <summary> /// Creates the solution folder node. /// </summary> /// <param name="solutionFolderName">Name of the solution folder.</param> /// <returns></returns> internal XmlNode CreateSolutionFolderNode(string solutionFolderName) { const string SOLUTIONFOLDER_NODE = "SolutionFolder"; const string NAME_ATT = "Name"; XmlNode solutionFolderNode = VSTemplateExporterHelper.CreateNode(vsTemplate, SOLUTIONFOLDER_NODE); solutionFolderNode.Attributes.Append(VSTemplateExporterHelper.CreateAttribute(vsTemplate, NAME_ATT, solutionFolderName)); return(solutionFolderNode); }
/// <summary> /// Creates the project item node. /// </summary> /// <param name="item">The item.</param> /// <param name="replaceParameters">if set to <c>true</c> [replace parameters].</param> /// <returns></returns> internal XmlNode CreateProjectItemNode(string item, bool replaceParameters) { const string PROJECTITEM_NODE = "ProjectItem"; const string REPLACEPARAMETERS_ATT_NAME = "ReplaceParameters"; const string TARGETFILENAME_ATT = "TargetFileName"; XmlNode projectItemNode = VSTemplateExporterHelper.CreateNode(vsTemplate, PROJECTITEM_NODE, item); projectItemNode.Attributes.Append(VSTemplateExporterHelper.CreateAttribute(vsTemplate, REPLACEPARAMETERS_ATT_NAME, replaceParameters.ToString().ToLowerInvariant())); projectItemNode.Attributes.Append(VSTemplateExporterHelper.CreateAttribute(vsTemplate, TARGETFILENAME_ATT, item)); return(projectItemNode); }
/// <summary> /// Creates the folder node. /// </summary> /// <param name="folderName">Name of the folder.</param> /// <returns></returns> internal XmlNode CreateFolderNode(string folderName) { const string FOLDER_NODE = "Folder"; const string NAME_ATT = "Name"; const string TARGETFOLDERNAME_ATT = "TargetFolderName"; XmlNode folderNode = VSTemplateExporterHelper.CreateNode(vsTemplate, FOLDER_NODE); folderNode.Attributes.Append(VSTemplateExporterHelper.CreateAttribute(vsTemplate, NAME_ATT, folderName)); folderNode.Attributes.Append(VSTemplateExporterHelper.CreateAttribute(vsTemplate, TARGETFOLDERNAME_ATT, folderName)); return(folderNode); }
/// <summary> /// Creates the project node. /// </summary> /// <returns></returns> internal XmlNode CreateProjectNode(string projectFileName) { const string PROJECT_NODE = "Project"; const string TARGETFILENAME_ATT = "TargetFileName"; const string FILE_ATT = "File"; const string REPLACEPARAMETERS_ATT_NAME = "ReplaceParameters"; const string REPLACEPARAMETERS_ATT_VALUE = "true"; XmlNode projectContent = VSTemplateExporterHelper.CreateNode(vsTemplate, PROJECT_NODE); projectContent.Attributes.Append(VSTemplateExporterHelper.CreateAttribute(vsTemplate, TARGETFILENAME_ATT, projectFileName)); projectContent.Attributes.Append(VSTemplateExporterHelper.CreateAttribute(vsTemplate, FILE_ATT, projectFileName)); projectContent.Attributes.Append(VSTemplateExporterHelper.CreateAttribute(vsTemplate, REPLACEPARAMETERS_ATT_NAME, REPLACEPARAMETERS_ATT_VALUE)); return(projectContent); }
/// <summary> /// Creates the template data node. /// </summary> /// <returns></returns> internal XmlNode CreateTemplateDataNode() { const string TEMPLATEDATA_NODE = "TemplateData"; const string NAME_ATT = "Name"; const string DESCRIPTION_ATT = "Description"; const string PROJECTTYPE_ATT = "ProjectType"; const string PROJECTSUBTYPE_ATT = "ProjectSubType"; const string SORTORDER_ATT = "SortOrder"; const string CREATENEWFOLDER_ATT = "CreateNewFolder"; const string DEFAULTNAME_ATT_NAME = "DefaultName"; const string PROVIDEDEFAULTNAME_ATT = "ProvideDefaultName"; const string LOCATIONFIELD_ATT_NAME = "LocationField"; const string ENABLELOCATIONBROWSEBUTTON_ATT = "EnableLocationBrowseButton"; const string ICON_ATT = "Icon"; XmlNode templateDataNode = vsTemplate.CreateElement(TEMPLATEDATA_NODE, string.Empty); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, NAME_ATT, this.Name)); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, DESCRIPTION_ATT, this.Description)); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, PROJECTTYPE_ATT, this.ProjectType.ToString())); if (this.projectSubType != ProjectType.None) { templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, PROJECTSUBTYPE_ATT, this.projectSubType.ToString())); } templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, SORTORDER_ATT, this.SortOrder.ToString(NumberFormatInfo.InvariantInfo))); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, CREATENEWFOLDER_ATT, this.CreateNewFolder.ToString(CultureInfo.InvariantCulture).ToLowerInvariant())); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, DEFAULTNAME_ATT_NAME, this.DefaultName)); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, PROVIDEDEFAULTNAME_ATT, this.ProvideDefaultName.ToString(CultureInfo.InvariantCulture).ToLowerInvariant())); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, LOCATIONFIELD_ATT_NAME, this.LocationField.ToString())); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, ENABLELOCATIONBROWSEBUTTON_ATT, this.EnableLocationBrowseButton.ToString(CultureInfo.InvariantCulture).ToLowerInvariant())); templateDataNode.AppendChild(VSTemplateExporterHelper.CreateNode(vsTemplate, ICON_ATT, this.Icon)); return(templateDataNode); }