public static bool HasXProjectXElement(this VisualStudioProjectFileXDocument visualStudioProjectFileXDocument, out XElement xProjectXElement) { xProjectXElement = visualStudioProjectFileXDocument.Value.Element(ProjectFileXmlElementName.Project); var hasXProjectXElement = XElementHelper.WasFound(xProjectXElement); return(hasXProjectXElement); }
public static bool HasProjectXElement(this VisualStudioProjectFileXDocument visualStudioProjectFileXDocument, out ProjectXElement projectXElement) { var hasProjectXElement = visualStudioProjectFileXDocument.HasXProjectXElement(out var xProjectXElement); projectXElement = xProjectXElement.AsProject(); return(hasProjectXElement); }
public static ProjectXElement GetProjectXElement(this VisualStudioProjectFileXDocument visualStudioProjectFileXDocument) { var xProjectXElement = visualStudioProjectFileXDocument.GetXProjectXElement(); var projectXElement = xProjectXElement.AsProject(); return(projectXElement); }
public static XElement GetXProjectXElement(this VisualStudioProjectFileXDocument visualStudioProjectFileXDocument) { var hasXProjectXElement = visualStudioProjectFileXDocument.HasXProjectXElement(out var xProjectXElement); if (!hasXProjectXElement) { throw new InvalidOperationException($"Visual Studio project file {nameof(XDocument)} does not have a {ProjectFileXmlElementName.Project} element."); } return(xProjectXElement); }
public static XDocumentVisualStudioProjectFile New() { var xProjectXElement = new XElement(ProjectFileXmlElementName.Project); var xDocument = new XDocument(); xDocument.Add(xProjectXElement); var visualStudioProjectFileXDocument = new VisualStudioProjectFileXDocument(xDocument); var xElementVisualStudioProjectFile = new XDocumentVisualStudioProjectFile(visualStudioProjectFileXDocument); return(xElementVisualStudioProjectFile); }
public static VisualStudioProjectFileXDocument AsVisualStudioProjectFile(this XDocument xDocument) { var visualStudioProjectFileXDocument = new VisualStudioProjectFileXDocument(xDocument); return(visualStudioProjectFileXDocument); }
public XDocumentVisualStudioProjectFile(VisualStudioProjectFileXDocument visualStudioProjectFileXDocument) { this.VisualStudoProjectFileXDocument = visualStudioProjectFileXDocument; this.ProjectXElement = this.VisualStudoProjectFileXDocument.GetProjectXElement(); }