コード例 #1
0
        private void SetFormatAndProjectTargets(PropertyGroupCollection propertyGroups, string project)
        {
            var targetElement = PropertyGroupXmlParser.GetOldStyleTargetElement(propertyGroups.PropertyGroupElements);

            if (targetElement == null)
            {
                targetElement = PropertyGroupXmlParser.GetNewStyleTargetElement(propertyGroups.PropertyGroupElements);

                if (targetElement == null)
                {
                    throw new InvalidDotNetProjectException("Project document contains no target framework.");
                }

                Format = ProjectFormat.New;
            }
            else
            {
                Format = ProjectFormat.Old;
            }

            ProjectTargets = targetElement
                             .Value
                             .Split(ProjectTargetDelimiter)
                             .Select(value => new DotNetProjectTarget(value));
        }
コード例 #2
0
        private void SetFormatAndProjectTargets(PropertyGroupCollection propertyGroups)
        {
            var targetElement = PropertyGroupXmlParser.GetOldStyleTargetElement(propertyGroups.PropertyGroupElements);

            if (targetElement == null)
            {
                targetElement = PropertyGroupXmlParser.GetNewStyleTargetElement(propertyGroups.PropertyGroupElements);

                Format = ProjectFormat.New;
            }
            else
            {
                Format = ProjectFormat.Old;
            }

            if (targetElement == null)
            {
                ProjectTargets = Enumerable.Empty <TargetFramework>();
            }
            else
            {
                ProjectTargets = targetElement
                                 .Value
                                 .Split(ProjectTargetDelimiter)
                                 .Select(value => new TargetFramework(value));
            }
        }