private void GetSDKManifestAttributes()

in src/Tasks/ResolveSDKReference.cs [1249:1397]


            private void GetSDKManifestAttributes()
            {
                if (_sdkManifest == null)
                {
                    _sdkManifestPath = Path.Combine(ResolvedPath, "SDKManifest.xml");

                    AddStatusMessage("ResolveSDKReference.ReadingSDKManifestFile", _sdkManifestPath);

                    _sdkManifest = new SDKManifest(ResolvedPath);

                    if (_sdkManifest.ReadError)
                    {
                        AddResolutionErrorOrWarning("ResolveSDKReference.ErrorResolvingSDK", ReferenceItem.ItemSpec, ResourceUtilities.FormatResourceString("ResolveSDKReference.ErrorReadingManifest", _sdkManifestPath, _sdkManifest.ReadErrorMessage));
                    }
                }

                SupportedArchitectures = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.SupportedArchitectures);
                if (String.IsNullOrEmpty(SupportedArchitectures))
                {
                    SupportedArchitectures = _sdkManifest.SupportedArchitectures ?? String.Empty;
                }

                DependsOnSDK = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.DependsOnSDK);
                if (String.IsNullOrEmpty(DependsOnSDK))
                {
                    DependsOnSDK = _sdkManifest.DependsOnSDK ?? String.Empty;
                }

                FrameworkIdentity = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.FrameworkIdentity);
                if (String.IsNullOrEmpty(FrameworkIdentity))
                {
                    if (_sdkManifest.FrameworkIdentities != null)
                    {
                        foreach (string key in _sdkManifest.FrameworkIdentities.Keys)
                        {
                            if (!FrameworkIdentitiesFromManifest.ContainsKey(key))
                            {
                                FrameworkIdentitiesFromManifest.Add(key, _sdkManifest.FrameworkIdentities[key]);
                            }
                        }
                    }

                    FrameworkIdentity = _sdkManifest.FrameworkIdentity ?? String.Empty;
                }

                AppxLocation = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.AppxLocation);
                if (String.IsNullOrEmpty(AppxLocation))
                {
                    if (_sdkManifest.AppxLocations != null)
                    {
                        foreach (string key in _sdkManifest.AppxLocations.Keys)
                        {
                            if (!AppxLocationsFromManifest.ContainsKey(key))
                            {
                                AppxLocationsFromManifest.Add(key, _sdkManifest.AppxLocations[key]);
                            }
                        }
                    }
                }

                PlatformIdentity = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.PlatformIdentity);
                if (String.IsNullOrEmpty(PlatformIdentity))
                {
                    PlatformIdentity = _sdkManifest.PlatformIdentity ?? String.Empty;
                }

                MinOSVersion = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.MinOSVersion);
                if (String.IsNullOrEmpty(MinOSVersion))
                {
                    MinOSVersion = _sdkManifest.MinOSVersion ?? String.Empty;
                }

                MaxOSVersionTested = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.MaxOSVersionTested);
                if (String.IsNullOrEmpty(MaxOSVersionTested))
                {
                    MaxOSVersionTested = _sdkManifest.MaxOSVersionTested ?? String.Empty;
                }

                MoreInfo = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.MoreInfo);
                if (String.IsNullOrEmpty(MoreInfo))
                {
                    MoreInfo = _sdkManifest.MoreInfo ?? String.Empty;
                }

                MaxPlatformVersion = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.MaxPlatformVersion);
                if (String.IsNullOrEmpty(MaxPlatformVersion))
                {
                    MaxPlatformVersion = _sdkManifest.MaxPlatformVersion ?? String.Empty;
                }

                TargetPlatform = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.TargetPlatform);
                if (String.IsNullOrEmpty(TargetPlatform))
                {
                    TargetPlatform = _sdkManifest.TargetPlatform ?? String.Empty;
                }

                TargetPlatformMinVersion = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.TargetPlatformMinVersion);
                if (String.IsNullOrEmpty(TargetPlatformMinVersion))
                {
                    TargetPlatformMinVersion = _sdkManifest.TargetPlatformMinVersion ?? String.Empty;
                }

                TargetPlatformVersion = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.TargetPlatformVersion);
                if (String.IsNullOrEmpty(TargetPlatformVersion))
                {
                    TargetPlatformVersion = _sdkManifest.TargetPlatformVersion ?? String.Empty;
                }

                string sdkTypeFromMetadata = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.SDKType);
                if (String.IsNullOrEmpty(sdkTypeFromMetadata))
                {
                    SDKType = _sdkManifest.SDKType;
                }
                else
                {
                    SDKType sdkType = SDKType.Unspecified;
                    Enum.TryParse<SDKType>(sdkTypeFromMetadata, out sdkType);
                    SDKType = sdkType;
                }

                DisplayName = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.DisplayName);
                if (String.IsNullOrEmpty(DisplayName))
                {
                    DisplayName = _sdkManifest.DisplayName ?? String.Empty;
                }

                SupportPrefer32Bit = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.SupportPrefer32Bit);
                if (String.IsNullOrEmpty(SupportPrefer32Bit))
                {
                    SupportPrefer32Bit = _sdkManifest.SupportPrefer32Bit ?? String.Empty;
                }

                CopyRedistToSubDirectory = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.CopyRedistToSubDirectory);
                if (String.IsNullOrEmpty(CopyRedistToSubDirectory))
                {
                    CopyRedistToSubDirectory = _sdkManifest.CopyRedistToSubDirectory ?? String.Empty;
                }

                ProductFamilyName = GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.ProductFamilyName);
                if (String.IsNullOrEmpty(ProductFamilyName))
                {
                    ProductFamilyName = _sdkManifest.ProductFamilyName ?? String.Empty;
                }

                if (!ParseSupportMultipleVersions(GetItemMetadataTrimmed(ReferenceItem, SDKManifest.Attributes.SupportsMultipleVersions)))
                {
                    _supportsMultipleVersions = _sdkManifest.SupportsMultipleVersions;
                }
            }