当前位置: 首页>>代码示例>>C#>>正文


C# XmlAttributeCollection.OfType方法代码示例

本文整理汇总了C#中System.Xml.XmlAttributeCollection.OfType方法的典型用法代码示例。如果您正苦于以下问题:C# XmlAttributeCollection.OfType方法的具体用法?C# XmlAttributeCollection.OfType怎么用?C# XmlAttributeCollection.OfType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlAttributeCollection的用法示例。


在下文中一共展示了XmlAttributeCollection.OfType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ValueAttributes

 private IEnumerable<XmlAttribute> ValueAttributes(XmlAttributeCollection c)
 {
   return c.OfType<XmlAttribute>().Where(a => a.NamespaceURI != JsonNamespaceUri);
 }
开发者ID:matthewcanty,项目名称:worldpay-lib-dotnet,代码行数:4,代码来源:XmlNodeConverter.cs

示例2: ReadFileListAttributes

        /// <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;
                    }
                }
            }
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:93,代码来源:SDKManifest.cs


注:本文中的System.Xml.XmlAttributeCollection.OfType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。