コード例 #1
0
        /// <summary>
        /// Reads the attributes from the "FileList" element of the SDK manifest.
        /// </summary>
        private void ReadFileListAttributes(XmlAttributeCollection attributes)
        {
            foreach (XmlAttribute attribute in attributes.OfType <XmlAttribute>())
            {
                string value = attribute.Value.Trim();
                if (value.Length > 0)
                {
                    if (attribute.Name.StartsWith(Attributes.FrameworkIdentity, StringComparison.OrdinalIgnoreCase))
                    {
                        if (_frameworkIdentities == null)
                        {
                            _frameworkIdentities = new Dictionary <string, string>();
                        }

                        _frameworkIdentities.Add(attribute.Name, value);
                        continue;
                    }

                    if (attribute.Name.StartsWith(Attributes.APPX, StringComparison.OrdinalIgnoreCase))
                    {
                        if (_appxLocations == null)
                        {
                            _appxLocations = new Dictionary <string, string>();
                        }

                        _appxLocations.Add(attribute.Name, value);
                        continue;
                    }

                    switch (attribute.Name)
                    {
                    case Attributes.TargetPlatform:
                        TargetPlatform = value;
                        break;

                    case Attributes.TargetPlatformMinVersion:
                        TargetPlatformMinVersion = value;
                        break;

                    case Attributes.TargetPlatformVersion:
                        TargetPlatformVersion = value;
                        break;

                    case Attributes.MinVSVersion:
                        MinVSVersion = value;
                        break;

                    case Attributes.MinOSVersion:
                        _minOSVersion = value;
                        break;

                    case Attributes.MaxOSVersionTested:
                        _maxOSVersionTested = value;
                        break;

                    case Attributes.MaxPlatformVersion:
                        _maxPlatformVersion = value;
                        break;

                    case Attributes.PlatformIdentity:
                        PlatformIdentity = value;
                        break;

                    case Attributes.SupportPrefer32Bit:
                        SupportPrefer32Bit = value;
                        break;

                    case Attributes.SupportsMultipleVersions:
                        _supportsMultipleVersions = ParseSupportMultipleVersions(value);
                        break;

                    case Attributes.SDKType:
                        Enum.TryParse(value, out _sdkType);
                        break;

                    case Attributes.DisplayName:
                        DisplayName = value;
                        break;

                    case Attributes.MoreInfo:
                        MoreInfo = value;
                        break;

                    case Attributes.CopyRedistToSubDirectory:
                        CopyRedistToSubDirectory = value;
                        break;

                    case Attributes.SupportedArchitectures:
                        SupportedArchitectures = value;
                        break;

                    case Attributes.DependsOnSDK:
                        DependsOnSDK = value;
                        break;

                    case Attributes.ProductFamilyName:
                        ProductFamilyName = value;
                        break;
                    }
                }
            }
        }
コード例 #2
0
ファイル: SDKManifest.cs プロジェクト: cameron314/msbuild
        /// <summary>
        /// Reads the attributes from the "FileList" element of the SDK manifest.
        /// </summary>
        private void ReadFileListAttributes(XmlAttributeCollection attributes)
        {
            foreach (XmlAttribute attribute in attributes.OfType<XmlAttribute>())
            {
                string value = attribute.Value.Trim();
                if (value.Length > 0)
                {
                    if (attribute.Name.StartsWith(SDKManifest.Attributes.FrameworkIdentity, StringComparison.OrdinalIgnoreCase))
                    {
                        if (_frameworkIdentities == null)
                        {
                            _frameworkIdentities = new Dictionary<string, string>();
                        }

                        _frameworkIdentities.Add(attribute.Name, value);
                        continue;
                    }

                    if (attribute.Name.StartsWith(SDKManifest.Attributes.APPX, StringComparison.OrdinalIgnoreCase))
                    {
                        if (_appxLocations == null)
                        {
                            _appxLocations = new Dictionary<string, string>();
                        }

                        _appxLocations.Add(attribute.Name, value);
                        continue;
                    }

                    switch (attribute.Name)
                    {
                        case SDKManifest.Attributes.TargetPlatform:
                            TargetPlatform = value;
                            break;
                        case SDKManifest.Attributes.TargetPlatformMinVersion:
                            TargetPlatformMinVersion = value;
                            break;
                        case SDKManifest.Attributes.TargetPlatformVersion:
                            TargetPlatformVersion = value;
                            break;
                        case SDKManifest.Attributes.MinVSVersion:
                            MinVSVersion = value;
                            break;
                        case SDKManifest.Attributes.MinOSVersion:
                            _minOSVersion = value;
                            break;
                        case SDKManifest.Attributes.MaxOSVersionTested:
                            _maxOSVersionTested = value;
                            break;
                        case SDKManifest.Attributes.MaxPlatformVersion:
                            _maxPlatformVersion = value;
                            break;
                        case SDKManifest.Attributes.PlatformIdentity:
                            PlatformIdentity = value;
                            break;
                        case SDKManifest.Attributes.SupportPrefer32Bit:
                            SupportPrefer32Bit = value;
                            break;
                        case SDKManifest.Attributes.SupportsMultipleVersions:
                            if (!ParseSupportMultipleVersions(value))
                            {
                                _supportsMultipleVersions = MultipleVersionSupport.Allow;
                            }

                            break;
                        case SDKManifest.Attributes.SDKType:
                            Enum.TryParse<SDKType>(value, out _sdkType);
                            break;
                        case SDKManifest.Attributes.DisplayName:
                            DisplayName = value;
                            break;
                        case SDKManifest.Attributes.MoreInfo:
                            MoreInfo = value;
                            break;
                        case SDKManifest.Attributes.CopyRedistToSubDirectory:
                            CopyRedistToSubDirectory = value;
                            break;
                        case SDKManifest.Attributes.SupportedArchitectures:
                            SupportedArchitectures = value;
                            break;
                        case SDKManifest.Attributes.DependsOnSDK:
                            DependsOnSDK = value;
                            break;
                        case SDKManifest.Attributes.ProductFamilyName:
                            ProductFamilyName = value;
                            break;
                    }
                }
            }
        }