Share via


DataSourceElementCollection 类

表示 XML 元素,此元素包含子 DataSourceElement 对象的集合。

继承层次结构

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 获取包含 ConfigurationElement 对象的不可自定义的信息和功能的 ElementInformation 对象。 (继承自 ConfigurationElement。)
受保护的属性 ElementName 获取在派生的类中重写时用于标识配置文件中此元素集合的名称。 (继承自 ConfigurationElementCollection。)
受保护的属性 ElementProperty 获取本身表示 ConfigurationElement 对象的 ConfigurationElementProperty 对象。 (继承自 ConfigurationElement。)
公共属性 EmitClear 获取或设置一个值,该值指定是否已清除集合。 (继承自 ConfigurationElementCollection。)
受保护的属性 EvaluationContext 获取 ConfigurationElement 对象的 ContextInformation 对象。 (继承自 ConfigurationElement。)
公共属性 IsSynchronized 获取一个值,该值指示对集合的访问是否为同步的(线程安全)。 (继承自 ConfigurationElementCollection。)
受保护的属性 Item[ConfigurationProperty] 获取或设置此配置元素的属性或特性。 (继承自 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 获取一个值,该值指示尝试向 ConfigurationElementCollection 添加重复的 ConfigurationElement 是否会导致引发异常。 (继承自 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 基础结构。获取用于循环访问 ConfigurationElementCollectionIEnumerator。 (继承自 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 的浅表副本。 (继承自 Object。)
受保护的方法 OnDeserializeUnrecognizedAttribute 获取一个值,该值指示反序列化过程中是否遇到未知特性。 (继承自 ConfigurationElement。)
受保护的方法 OnDeserializeUnrecognizedElement 导致配置系统引发异常。 (继承自 ConfigurationElementCollection。)
受保护的方法 OnRequiredPropertyNotFound 未找到所需属性时引发异常。 (继承自 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。)

页首

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.VisualStudio.TestTools.UnitTesting 命名空间

DataSourceElement