XmlAttributeCollection XmlAttributeCollection XmlAttributeCollection XmlAttributeCollection Class

定义

表示可以按名称或索引访问的特性的集合。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
继承
XmlAttributeCollectionXmlAttributeCollectionXmlAttributeCollectionXmlAttributeCollection
实现

注解

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

属性

Count Count Count Count

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

(Inherited from XmlNamedNodeMap)
ItemOf[Int32] ItemOf[Int32] ItemOf[Int32] ItemOf[Int32]

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

ItemOf[String, String] ItemOf[String, String] ItemOf[String, String] ItemOf[String, String]

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

ItemOf[String] ItemOf[String] ItemOf[String] ItemOf[String]

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

方法

Append(XmlAttribute) Append(XmlAttribute) Append(XmlAttribute) Append(XmlAttribute)

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

CopyTo(XmlAttribute[], Int32) CopyTo(XmlAttribute[], Int32) CopyTo(XmlAttribute[], Int32) CopyTo(XmlAttribute[], Int32)

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

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

(Inherited from XmlNamedNodeMap)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetNamedItem(String) GetNamedItem(String) GetNamedItem(String) GetNamedItem(String)

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

(Inherited from XmlNamedNodeMap)
GetNamedItem(String, String) GetNamedItem(String, String) GetNamedItem(String, String) GetNamedItem(String, String)

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

(Inherited from XmlNamedNodeMap)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
InsertAfter(XmlAttribute, XmlAttribute) InsertAfter(XmlAttribute, XmlAttribute) InsertAfter(XmlAttribute, XmlAttribute) InsertAfter(XmlAttribute, XmlAttribute)

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

InsertBefore(XmlAttribute, XmlAttribute) InsertBefore(XmlAttribute, XmlAttribute) InsertBefore(XmlAttribute, XmlAttribute) InsertBefore(XmlAttribute, XmlAttribute)

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

Item(Int32) Item(Int32) Item(Int32) Item(Int32)

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

(Inherited from XmlNamedNodeMap)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
Prepend(XmlAttribute) Prepend(XmlAttribute) Prepend(XmlAttribute) Prepend(XmlAttribute)

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

Remove(XmlAttribute) Remove(XmlAttribute) Remove(XmlAttribute) Remove(XmlAttribute)

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

RemoveAll() RemoveAll() RemoveAll() RemoveAll()

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

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

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

RemoveNamedItem(String) RemoveNamedItem(String) RemoveNamedItem(String) RemoveNamedItem(String)

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

(Inherited from XmlNamedNodeMap)
RemoveNamedItem(String, String) RemoveNamedItem(String, String) RemoveNamedItem(String, String) RemoveNamedItem(String, String)

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

(Inherited from XmlNamedNodeMap)
SetNamedItem(XmlNode) SetNamedItem(XmlNode) SetNamedItem(XmlNode) SetNamedItem(XmlNode)

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

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

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

ICollection.Count ICollection.Count ICollection.Count ICollection.Count

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

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

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

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

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

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

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

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅