AutomationElementCollection 类

定义

表示 AutomationElement 对象集合。Represents a collection of AutomationElement objects.

public ref class AutomationElementCollection : System::Collections::ICollection
public class AutomationElementCollection : System.Collections.ICollection
type AutomationElementCollection = class
    interface ICollection
    interface IEnumerable
Public Class AutomationElementCollection
Implements ICollection
继承
AutomationElementCollection
实现

注解

AutomationElementCollection用作方法 (如) FindAll的返回类型。AutomationElementCollection is used as the return type for methods such as FindAll. 它不用于应用程序定义的集合, 您应使用更通用的类 (如) ArrayListIt is not intended to be used for application-defined collections, for which you should use a more generic class such as ArrayList.

属性

Count

获取此集合中的元素数。Gets the number of elements in this collection.

IsSynchronized

获取一个值,该值指示 AutomationElementCollection 对象是否是同步的(线程安全)。Gets a value indicating whether the AutomationElementCollection object is synchronized (thread-safe).

Item[Int32]

获取位于指定索引处的 AutomationElementGets the AutomationElement at the specified index.

SyncRoot

获取可用于同步对 AutomationElementCollection 集合的访问的对象。Gets an object that can be used to synchronize access to the AutomationElementCollection collection.

方法

CopyTo(Array, Int32)

将集合的元素复制到一个数组,复制从目标数组中的指定索引处开始。Copies the collection's elements to an array, starting at the specified index in the target array.

CopyTo(AutomationElement[], Int32)

将集合的元素复制到一个特殊的数组实例,复制目标数组中的指定索引处开始。Copies the collection's elements to a specialized array instance, starting at the specified index in the target array.

Equals(Object)

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

(继承自 Object)
GetEnumerator()

返回一个枚举数,它可用于循环访问集合中的项。Returns an enumerator that can be used to iterate through the items in the collection.

GetHashCode()

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

(继承自 Object)
GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 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.

适用于

另请参阅