CacheRequest.Add Método

Definición

Agrega una propiedad o un identificador de patrón a .CacheRequest

Sobrecargas

Nombre Description
Add(AutomationPattern)

Agrega el identificador especificado AutomationPattern a este CacheRequest.

Add(AutomationProperty)

Agrega el identificador especificado AutomationProperty a este CacheRequest.

Comentarios

Cuando se crea un CacheRequest objeto, el RuntimeIdProperty identificador se agrega como una propiedad predeterminada para almacenar en caché.

Agregar un objeto que ya está en la solicitud de caché no tiene ningún efecto.

Add(AutomationPattern)

Agrega el identificador especificado AutomationPattern a este CacheRequest.

public:
 void Add(System::Windows::Automation::AutomationPattern ^ pattern);
public void Add(System.Windows.Automation.AutomationPattern pattern);
member this.Add : System.Windows.Automation.AutomationPattern -> unit
Public Sub Add (pattern As AutomationPattern)

Parámetros

pattern
AutomationPattern

Identificador que especifica un patrón que se va a almacenar en caché.

Excepciones

Ejemplos

En el ejemplo siguiente se muestra cómo construir y CacheRequest agregar un patrón que se va a almacenar en caché.

CacheRequest cacheRequest = new CacheRequest();
cacheRequest.Add(AutomationElement.NameProperty);
cacheRequest.Add(AutomationElement.IsEnabledProperty);
cacheRequest.Add(SelectionItemPattern.Pattern);
cacheRequest.Add(SelectionItemPattern.SelectionContainerProperty);
Dim myCacheRequest As New CacheRequest()
myCacheRequest.Add(AutomationElement.NameProperty)
myCacheRequest.Add(AutomationElement.IsEnabledProperty)
myCacheRequest.Add(SelectionItemPattern.Pattern)
myCacheRequest.Add(SelectionItemPattern.SelectionContainerProperty)

Comentarios

Agregar un patrón que ya está en la solicitud de caché no tiene ningún efecto.

Consulte también

Se aplica a

Add(AutomationProperty)

Agrega el identificador especificado AutomationProperty a este CacheRequest.

public:
 void Add(System::Windows::Automation::AutomationProperty ^ property);
public void Add(System.Windows.Automation.AutomationProperty property);
member this.Add : System.Windows.Automation.AutomationProperty -> unit
Public Sub Add (property As AutomationProperty)

Parámetros

property
AutomationProperty

Identificador que especifica un valor de propiedad que se va a almacenar en caché.

Excepciones

Ejemplos

En el ejemplo siguiente se muestra cómo construir y CacheRequest agregar una propiedad que se va a almacenar en caché.

CacheRequest cacheRequest = new CacheRequest();
cacheRequest.Add(AutomationElement.NameProperty);
cacheRequest.Add(AutomationElement.IsEnabledProperty);
cacheRequest.Add(SelectionItemPattern.Pattern);
cacheRequest.Add(SelectionItemPattern.SelectionContainerProperty);
Dim myCacheRequest As New CacheRequest()
myCacheRequest.Add(AutomationElement.NameProperty)
myCacheRequest.Add(AutomationElement.IsEnabledProperty)
myCacheRequest.Add(SelectionItemPattern.Pattern)
myCacheRequest.Add(SelectionItemPattern.SelectionContainerProperty)

Comentarios

Cuando se crea , CacheRequest el RuntimeIdProperty identificador se agrega como una propiedad predeterminada a la memoria caché.

Agregar una propiedad que ya está en la solicitud de caché no tiene ningún efecto.

Consulte también

Se aplica a