XmlAttributeCollection 类

定义

表示可以按名称或索引访问的属性的集合。Represents a collection of attributes that can be accessed by name or index.

public ref class XmlAttributeCollection sealed : System::Xml::XmlNamedNodeMap, System::Collections::ICollection
public sealed class XmlAttributeCollection : System.Xml.XmlNamedNodeMap, System.Collections.ICollection
type XmlAttributeCollection = class
    inherit XmlNamedNodeMap
    interface ICollection
    interface IEnumerable
Public NotInheritable Class XmlAttributeCollection
Inherits XmlNamedNodeMap
Implements ICollection
继承
XmlAttributeCollection
实现

注解

XmlAttributeCollection 通过添加强类型化 helper 方法扩展 @no__t 1 类。XmlAttributeCollection extends the XmlNamedNodeMap class by adding strongly typed helper methods. 您可以使用此类添加、移除或修改集合中的特性。You can use this class to add, remove, or modify attributes in the collection. XmlAttributeCollection 由 @no__t 属性返回。XmlAttributeCollection is returned by the XmlElement.Attributes property.

属性

Count

获取 XmlNamedNodeMap 中的节点数。Gets the number of nodes in the XmlNamedNodeMap.

(继承自 XmlNamedNodeMap)
ItemOf[Int32]

获取具有指定索引的特性。Gets the attribute with the specified index.

ItemOf[String, String]

获取具有指定的本地名称和命名空间唯一资源标识符 (URI) 的特性。Gets the attribute with the specified local name and namespace Uniform Resource Identifier (URI).

ItemOf[String]

获取具有指定名称的特性。Gets the attribute with the specified name.

方法

Append(XmlAttribute)

将指定的特性插入集合,并将其作为集合中的最后一个节点。Inserts the specified attribute as the last node in the collection.

CopyTo(XmlAttribute[], Int32)

从该集合中将所有 XmlAttribute 对象复制到给定数组。Copies all the XmlAttribute objects from this collection into the given array.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetEnumerator()

提供对 XmlNamedNodeMap 中节点集合上“foreach”样式迭代的支持。Provides support for the "foreach" style iteration over the collection of nodes in the XmlNamedNodeMap.

(继承自 XmlNamedNodeMap)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetNamedItem(String)

检索通过名称指定的 XmlNodeRetrieves an XmlNode specified by name.

(继承自 XmlNamedNodeMap)
GetNamedItem(String, String)

检索具有匹配的 LocalNameNamespaceURI 的节点。Retrieves a node with the matching LocalName and NamespaceURI.

(继承自 XmlNamedNodeMap)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
InsertAfter(XmlAttribute, XmlAttribute)

将指定特性直接插入到指定引用特性之后。Inserts the specified attribute immediately after the specified reference attribute.

InsertBefore(XmlAttribute, XmlAttribute)

将指定特性直接插入到指定引用特性之前。Inserts the specified attribute immediately before the specified reference attribute.

Item(Int32)

检索位于 XmlNamedNodeMap 中指定索引处的节点。Retrieves the node at the specified index in the XmlNamedNodeMap.

(继承自 XmlNamedNodeMap)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Prepend(XmlAttribute)

将指定特性插入集合中,并将其作为集合的第一个节点。Inserts the specified attribute as the first node in the collection.

Remove(XmlAttribute)

从集合中移除指定的特性。Removes the specified attribute from the collection.

RemoveAll()

从集合中移除所有特性。Removes all attributes from the collection.

RemoveAt(Int32)

从集合中移除与指定的索引对应的特性。Removes the attribute corresponding to the specified index from the collection.

RemoveNamedItem(String)

XmlNamedNodeMap 中移除节点。Removes the node from the XmlNamedNodeMap.

(继承自 XmlNamedNodeMap)
RemoveNamedItem(String, String)

移除具有匹配的 LocalNameNamespaceURI 的节点。Removes a node with the matching LocalName and NamespaceURI.

(继承自 XmlNamedNodeMap)
SetNamedItem(XmlNode)

使用 Name 属性添加 XmlNodeAdds a XmlNode using its Name property.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

显式界面实现

ICollection.CopyTo(Array, Int32)

有关此成员的说明,请参见 CopyTo(XmlAttribute[], Int32)For a description of this member, see CopyTo(XmlAttribute[], Int32).

ICollection.Count

有关此成员的说明,请参见 ICollection.CountFor a description of this member, see ICollection.Count.

ICollection.IsSynchronized

有关此成员的说明,请参见 ICollection.IsSynchronizedFor a description of this member, see ICollection.IsSynchronized.

ICollection.SyncRoot

有关此成员的说明,请参见 ICollection.SyncRootFor a description of this member, see ICollection.SyncRoot.

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅