DataSourceElementCollection 類別

表示包含子系 DataSourceElement 物件集合的 XML 項目。

繼承階層架構

System.Object
  System.Configuration.ConfigurationElement
    System.Configuration.ConfigurationElementCollection
      Microsoft.VisualStudio.TestTools.UnitTesting.DataSourceElementCollection

命名空間:  Microsoft.VisualStudio.TestTools.UnitTesting
組件:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)

語法

'宣告
Public NotInheritable Class DataSourceElementCollection _
    Inherits ConfigurationElementCollection
public sealed class DataSourceElementCollection : ConfigurationElementCollection
public ref class DataSourceElementCollection sealed : public ConfigurationElementCollection
[<Sealed>]
type DataSourceElementCollection =  
    class
        inherit ConfigurationElementCollection
    end
public final class DataSourceElementCollection extends ConfigurationElementCollection

DataSourceElementCollection 型別會公開下列成員。

建構函式

  名稱 說明
公用方法 DataSourceElementCollection 初始化 DataSourceElementCollection 類別的新執行個體。

回頁首

屬性

  名稱 說明
受保護的屬性 AddElementName 取得或設定 ConfigurationElement 的名稱,以在衍生類別中覆寫時,與 ConfigurationElementCollection 中的加入作業相關聯。 (繼承自 ConfigurationElementCollection)。
受保護的屬性 ClearElementName 取得或設定 ConfigurationElement 的名稱,以在衍生類別中覆寫時,與 ConfigurationElementCollection 中的清除作業相關聯。 (繼承自 ConfigurationElementCollection)。
公用屬性 CollectionType 取得 ConfigurationElementCollection 的類型。 (繼承自 ConfigurationElementCollection)。
公用屬性 Count 取得集合中的元素數目。 (繼承自 ConfigurationElementCollection)。
公用屬性 CurrentConfiguration 取得最上層 Configuration 執行個體的參考,這個執行個體表示目前 ConfigurationElement 執行個體所屬的組態階層架構。 (繼承自 ConfigurationElement)。
公用屬性 ElementInformation 取得 ElementInformation 物件,其中包含 ConfigurationElement 物件之不可自訂的資訊和功能。 (繼承自 ConfigurationElement)。
受保護的屬性 ElementName 在衍生類別中覆寫時,取得用於識別組態檔中這個項目集合的名稱。 (繼承自 ConfigurationElementCollection)。
受保護的屬性 ElementProperty 取得表示 ConfigurationElement 物件本身的 ConfigurationElementProperty 物件。 (繼承自 ConfigurationElement)。
公用屬性 EmitClear 取得或設定值,這個值指定是否已經清除集合。 (繼承自 ConfigurationElementCollection)。
受保護的屬性 EvaluationContext 取得 ConfigurationElement 物件的 ContextInformation 物件。 (繼承自 ConfigurationElement)。
公用屬性 IsSynchronized 取得值,指出是否同步處理對集合的存取 (執行緒安全)。 (繼承自 ConfigurationElementCollection)。
受保護的屬性 Item[ConfigurationProperty] 取得或設定此組態項目的屬性 (Property) 或屬性 (Attribute)。 (繼承自 ConfigurationElement)。
公用屬性 Item[Int32] 取得或設定位於指定索引上的 DataSourceElement
公用屬性 Item[String] 取得由名稱所識別的 DataSourceElement
公用屬性 LockAllAttributesExcept 取得已鎖定屬性的集合。 (繼承自 ConfigurationElement)。
公用屬性 LockAllElementsExcept 取得已鎖定項目的集合。 (繼承自 ConfigurationElement)。
公用屬性 LockAttributes 取得已鎖定屬性的集合。 (繼承自 ConfigurationElement)。
公用屬性 LockElements 取得已鎖定項目的集合。 (繼承自 ConfigurationElement)。
公用屬性 LockItem 取得或設定值,指出此項目是否已被鎖定。 (繼承自 ConfigurationElement)。
受保護的屬性 Properties 取得屬性的集合。 (繼承自 ConfigurationElement)。
受保護的屬性 RemoveElementName 取得或設定 ConfigurationElement 的名稱,以在衍生類別中覆寫時,與 ConfigurationElementCollection 中的移除作業相關聯。 (繼承自 ConfigurationElementCollection)。
公用屬性 SyncRoot 取得用於同步存取 ConfigurationElementCollection 的物件。 (繼承自 ConfigurationElementCollection)。
受保護的屬性 ThrowOnDuplicate 取得值,指出嘗試將重複的 ConfigurationElement 加入 ConfigurationElementCollection 是否會導致擲回例外狀況。 (繼承自 ConfigurationElementCollection)。

回頁首

方法

  名稱 說明
公用方法 Add 將資料來源項目加入至 DataSourceElementCollection。
受保護的方法 BaseAdd(ConfigurationElement) 將組態項目加入 ConfigurationElementCollection。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseAdd(ConfigurationElement, Boolean) 將組態項目加入組態項目集合。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseAdd(Int32, ConfigurationElement) 將組態項目加入組態項目集合。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseClear 從集合移除所有組態項目物件。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseGet(Object) 傳回具有指定索引鍵的組態項目。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseGet(Int32) 取得位在指定之索引位置的組態項目。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseGetAllKeys 傳回包含在 ConfigurationElementCollection 中所有組態項目的索引鍵陣列。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseGetKey 取得在指定之索引位置的 ConfigurationElement 索引鍵。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseIndexOf 指定之 ConfigurationElement 的索引。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseIsRemoved 取得值,指出是否已從 ConfigurationElementCollection 移除具有指定索引鍵的 ConfigurationElement。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseRemove 從集合移除 ConfigurationElement。 (繼承自 ConfigurationElementCollection)。
受保護的方法 BaseRemoveAt 移除在指定之索引位置的 ConfigurationElement。 (繼承自 ConfigurationElementCollection)。
公用方法 Clear 從集合中移除所有資料來源項目物件。
公用方法 CopyTo 複製 ConfigurationElementCollection 的內容至陣列。 (繼承自 ConfigurationElementCollection)。
受保護的方法 CreateNewElement() 在衍生類別中覆寫時,建立新的 ConfigurationElement。 (繼承自 ConfigurationElementCollection)。
受保護的方法 CreateNewElement(String) 在衍生類別中覆寫時,建立新的 ConfigurationElement。 (繼承自 ConfigurationElementCollection)。
受保護的方法 DeserializeElement 從組態檔讀取 XML。 (繼承自 ConfigurationElement)。
公用方法 Equals ConfigurationElementCollection 與指定的物件相比較。 (繼承自 ConfigurationElementCollection)。
受保護的方法 Finalize 允許物件在記憶體回收進行回收之前,嘗試釋放資源並執行其他清除作業。 (繼承自 Object)。
受保護的方法 GetElementKey 在衍生類別中覆寫時,取得指定組態項目的項目索引鍵。 (繼承自 ConfigurationElementCollection)。
公用方法 GetEnumerator 基礎架構。取得 IEnumerator,其用於逐一查看 ConfigurationElementCollection。 (繼承自 ConfigurationElementCollection)。
公用方法 GetHashCode 取得表示 ConfigurationElementCollection 執行個體的唯一值。 (繼承自 ConfigurationElementCollection)。
受保護的方法 GetTransformedAssemblyString 傳回指定之組件名稱的轉換版本。 (繼承自 ConfigurationElement)。
受保護的方法 GetTransformedTypeString 傳回指定之型別名稱的轉換版本。 (繼承自 ConfigurationElement)。
公用方法 GetType 取得目前執行個體的 Type。 (繼承自 Object)。
受保護的方法 Init ConfigurationElement 物件設定為它的初始狀態。 (繼承自 ConfigurationElement)。
受保護的方法 InitializeDefault 用來初始化 ConfigurationElement 物件的預設值集。 (繼承自 ConfigurationElement)。
受保護的方法 IsElementName 指出指定的 ConfigurationElement 是否存在於 ConfigurationElementCollection 中。 (繼承自 ConfigurationElementCollection)。
受保護的方法 IsElementRemovable 取得值,指出是否可以從 ConfigurationElementCollection 移除指定的 ConfigurationElement。 (繼承自 ConfigurationElementCollection)。
受保護的方法 IsModified 在衍生類別中覆寫時,指出這個 ConfigurationElementCollection 自上次儲存或載入後是否已修改。 (繼承自 ConfigurationElementCollection)。
公用方法 IsReadOnly 取得值,指出 ConfigurationElementCollection 物件是否為唯讀。 (繼承自 ConfigurationElementCollection)。
受保護的方法 ListErrors 將這個 ConfigurationElement 物件中和所有子項目中的無效屬性錯誤加入傳遞的清單。 (繼承自 ConfigurationElement)。
受保護的方法 MemberwiseClone 建立目前 Object 的淺層複本 (Shallow Copy)。 (繼承自 Object)。
受保護的方法 OnDeserializeUnrecognizedAttribute 取得值,指出在還原序列化程序中是否遇到未知的屬性 (Attribute)。 (繼承自 ConfigurationElement)。
受保護的方法 OnDeserializeUnrecognizedElement 導致組態系統擲回例外狀況。 (繼承自 ConfigurationElementCollection)。
受保護的方法 OnRequiredPropertyNotFound 在找不到必要的屬性時擲回例外狀況 (Exception)。 (繼承自 ConfigurationElement)。
受保護的方法 PostDeserialize 還原序列化之後呼叫。 (繼承自 ConfigurationElement)。
受保護的方法 PreSerialize 序列化之前呼叫。 (繼承自 ConfigurationElement)。
公用方法 Remove(String) 從集合移除 DataSourceElement
公用方法 Remove(DataSourceElement) 從集合移除 DataSourceElement
受保護的方法 Reset 在衍生類別中覆寫時,將 ConfigurationElementCollection 重設為其未修改的狀態。 (繼承自 ConfigurationElementCollection)。
受保護的方法 ResetModified 在衍生類別中覆寫時,將 IsModified 屬性的值重設為 false。 (繼承自 ConfigurationElementCollection)。
受保護的方法 SerializeElement 在衍生類別中覆寫時,將組態資料寫入組態檔的 XML 項目中。 (繼承自 ConfigurationElementCollection)。
受保護的方法 SerializeToXmlElement 在衍生類別中實作時,將此組態項目的外部標記寫入組態檔中。 (繼承自 ConfigurationElement)。
受保護的方法 SetPropertyValue 將屬性設定為指定的值。 (繼承自 ConfigurationElement)。
受保護的方法 SetReadOnly 基礎架構。設定 ConfigurationElementCollection 物件和所有子項目的 IsReadOnly 屬性。 (繼承自 ConfigurationElementCollection)。
公用方法 ToString 傳回表示目前物件的字串。 (繼承自 Object)。
受保護的方法 Unmerge 基礎架構。抵銷從不同組態階層架構層合併組態資訊的影響 (繼承自 ConfigurationElementCollection)。

回頁首

明確介面實作

  名稱 說明
明確介面實作私用方法 ICollection.CopyTo 複製 ConfigurationElementCollection 至陣列。 (繼承自 ConfigurationElementCollection)。

回頁首

執行緒安全

這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。

請參閱

參考

Microsoft.VisualStudio.TestTools.UnitTesting 命名空間

DataSourceElement