XmlAttributeCollection XmlAttributeCollection XmlAttributeCollection XmlAttributeCollection Class

定義

表示可用名稱或索引存取的屬性 (Attribute) 集合。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藉由加入強型別 helper 方法來擴充類別。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. XmlAttributeCollection是由XmlElement.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 的淺層複本 (Shallow Copy)。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.

適用於

另請參閱