Esempio n. 1
0
        /// <summary>
        /// Gets the top-level property group, and if it doesn't exist, creates it.
        /// </summary>
        public static ProjectPropertyGroupElement GetOrCreateTopLevelPropertyGroup(BaselineProject baselineProject, IProjectRootElement projectRootElement)
        {
            bool IsAfterFirstImport(ProjectPropertyGroupElement propertyGroup)
            {
                if (baselineProject.ProjectStyle == ProjectStyle.Default ||
                    baselineProject.ProjectStyle == ProjectStyle.WindowsDesktop ||
                    baselineProject.ProjectStyle == ProjectStyle.DefaultSubset)
                {
                    return(true);
                }

                var firstImport = projectRootElement.Imports.Where(i => i.Label != MSBuildFacts.SharedProjectsImportLabel).FirstOrDefault();

                return(firstImport is { } && propertyGroup.Location.Line > firstImport.Location.Line);
            }
 public MSBuildWorkspaceItem(IProjectRootElement root, UnconfiguredProject unconfiguredProject, BaselineProject baseline)
 {
     ProjectRootElement  = root;
     UnconfiguredProject = unconfiguredProject;
     SdkBaselineProject  = baseline;
 }