XmlArrayItemAttributes 類別

定義

表示 XmlArrayItemAttribute 物件的集合。Represents a collection of XmlArrayItemAttribute objects.

public ref class XmlArrayItemAttributes : System::Collections::CollectionBase
public class XmlArrayItemAttributes : System.Collections.CollectionBase
type XmlArrayItemAttributes = class
    inherit CollectionBase
Public Class XmlArrayItemAttributes
Inherits CollectionBase
繼承
XmlArrayItemAttributes
繼承
XmlArrayItemAttributes

備註

XmlArrayItemAttributes 類別可讓您指定可以插入至公用欄位或公用讀取/寫入屬性所傳回之陣列中的衍生類型。The XmlArrayItemAttributes class allows you to specify the derived types that can be inserted into an array returned by a public field or public read/write property.

XmlAttributes 類別的 XmlArrayItems 屬性會傳回這個類別的實例。An instance of this class is returned by the XmlArrayItems property of the XmlAttributes class. 當覆寫可以插入已套用 XmlArrayAttribute 之陣列中的 XmlArrayItemAttribute 物件集時,會使用 XmlAttributes 類別。The XmlAttributes class is used when overriding the set of XmlArrayItemAttribute objects that can be inserted into an array to which the XmlArrayAttribute has been applied.

針對您想要讓欄位或屬性接受的每個新類型,建立 XmlArrayItemAttribute 並使用 Add,將物件新增至 XmlArrayItems 屬性所傳回的 XmlArrayItemAttributes 集合。For each new type you want the field or property to accept, create an XmlArrayItemAttribute and use the Add to add the object to the XmlArrayItemAttributes collection returned by the XmlArrayItems property. Add XmlAttributesXmlAttributeOverrides,指定包含欄位或屬性之物件的型別,以及欄位或屬性的名稱。Add the XmlAttributes to an XmlAttributeOverrides, that specifies the type of the object that contains the field or property, and the name of the field or property. 在呼叫 SerializeDeserialize 方法之前,先使用 XmlAttributeOverrides 來建立 XmlSerializerConstruct an XmlSerializer with the XmlAttributeOverrides before calling the Serialize or Deserialize method.

建構函式

XmlArrayItemAttributes()

初始化 XmlArrayItemAttributes 類別的新執行個體。Initializes a new instance of the XmlArrayItemAttributes class.

屬性

Capacity

取得或設定 CollectionBase 可包含的項目數目。Gets or sets the number of elements that the CollectionBase can contain.

(繼承來源 CollectionBase)
Count
InnerList

取得包含 ArrayList 執行個體中之元素清單的 CollectionBaseGets an ArrayList containing the list of elements in the CollectionBase instance.

(繼承來源 CollectionBase)
Item[Int32]

取得或設定指定之索引處的項目。Gets or sets the item at the specified index.

List

取得包含 IList 執行個體中之元素清單的 CollectionBaseGets an IList containing the list of elements in the CollectionBase instance.

(繼承來源 CollectionBase)

方法

Add(XmlArrayItemAttribute)

XmlArrayItemAttribute 加入至集合。Adds an XmlArrayItemAttribute to the collection.

Clear()
Contains(XmlArrayItemAttribute)

判斷集合是否包含指定的 XmlArrayItemAttributeDetermines whether the collection contains the specified XmlArrayItemAttribute.

CopyTo(XmlArrayItemAttribute[], Int32)

從指定的目標索引,複製 XmlArrayItemAttribute 陣列至集合。Copies an XmlArrayItemAttribute array to the collection, starting at a specified target index.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetEnumerator()
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IndexOf(XmlArrayItemAttribute)

傳回集合中找到的第一個指定 XmlArrayItemAttribute 之以零起始的索引,如果在集合中找不到屬性,則為 -1。Returns the zero-based index of the first occurrence of the specified XmlArrayItemAttribute in the collection or -1 if the attribute is not found in the collection.

Insert(Int32, XmlArrayItemAttribute)

XmlArrayItemAttribute 插入集合中指定的索引處。Inserts an XmlArrayItemAttribute into the collection at the specified index.

MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnClear()

在清除 CollectionBase 執行個體的內容之後,執行額外的自訂處理序。Performs additional custom processes when clearing the contents of the CollectionBase instance.

(繼承來源 CollectionBase)
OnClearComplete()

在清除 CollectionBase 執行個體的內容後,執行額外的自訂處理序。Performs additional custom processes after clearing the contents of the CollectionBase instance.

(繼承來源 CollectionBase)
OnInsert(Int32, Object)

在將新的元素插入至 CollectionBase 執行個體前,執行額外的自訂處理序。Performs additional custom processes before inserting a new element into the CollectionBase instance.

(繼承來源 CollectionBase)
OnInsertComplete(Int32, Object)

在將新的元素插入至 CollectionBase 執行個體後,執行額外的自訂處理序。Performs additional custom processes after inserting a new element into the CollectionBase instance.

(繼承來源 CollectionBase)
OnRemove(Int32, Object)

當從 CollectionBase 執行個體移除元素時,執行額外的自訂處理序。Performs additional custom processes when removing an element from the CollectionBase instance.

(繼承來源 CollectionBase)
OnRemoveComplete(Int32, Object)

在從 CollectionBase 執行個體移除元素後,執行額外的自訂處理序。Performs additional custom processes after removing an element from the CollectionBase instance.

(繼承來源 CollectionBase)
OnSet(Int32, Object, Object)

CollectionBase 執行個體中設定數值前,執行額外的自訂處理序。Performs additional custom processes before setting a value in the CollectionBase instance.

(繼承來源 CollectionBase)
OnSetComplete(Int32, Object, Object)

CollectionBase 執行個體中設定數值後,執行額外的自訂處理序。Performs additional custom processes after setting a value in the CollectionBase instance.

(繼承來源 CollectionBase)
OnValidate(Object)

當驗證數值時,執行額外的自訂處理序。Performs additional custom processes when validating a value.

(繼承來源 CollectionBase)
Remove(XmlArrayItemAttribute)

如果存在 XmlArrayItemAttribute,則從集合移除它。Removes an XmlArrayItemAttribute from the collection, if it is present.

RemoveAt(Int32)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

明確介面實作

ICollection.CopyTo(Array, Int32)
ICollection.IsSynchronized
ICollection.SyncRoot
IList.Add(Object)
IList.Contains(Object)
IList.IndexOf(Object)
IList.Insert(Int32, Object)
IList.IsFixedSize
IList.IsReadOnly
IList.Item[Int32]
IList.Remove(Object)

擴充方法

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.

適用於

另請參閱