コード例 #1
0
        void RemoveMSBuildProjectNameDerivedProperties(MSBuildPropertyGroup globalPropertyGroup)
        {
            string msbuildProjectName = globalPropertyGroup.ParentProject.FileName.FileNameWithoutExtension;

            if (!hasAssemblyName)
            {
                globalPropertyGroup.RemovePropertyIfHasDefaultValue("AssemblyName", msbuildProjectName);
            }

            if (!hasRootNamespace)
            {
                globalPropertyGroup.RemovePropertyIfHasDefaultValue("RootNamespace", msbuildProjectName);
            }
        }
コード例 #2
0
        static void RemoveOutputTypeIfHasDefaultValue(MSBuildProject project, MSBuildPropertyGroup globalPropertyGroup)
        {
            string outputType = project.EvaluatedProperties.GetValue("OutputType");

            if (string.IsNullOrEmpty(outputType))
            {
                globalPropertyGroup.RemoveProperty("OutputType");
            }
            else
            {
                globalPropertyGroup.RemovePropertyIfHasDefaultValue("OutputType", outputType);
            }
        }