CacheRequest.Add Metodo

Definizione

Aggiunge una proprietà o un identificatore di pattern a un oggetto CacheRequest.

Overload

Nome Descrizione
Add(AutomationPattern)

Aggiunge l'identificatore specificato AutomationPattern a questo CacheRequestoggetto .

Add(AutomationProperty)

Aggiunge l'identificatore specificato AutomationProperty a questo CacheRequestoggetto .

Commenti

Quando viene creato un CacheRequest oggetto, l'identificatore RuntimeIdProperty viene aggiunto come proprietà predefinita per la cache.

L'aggiunta di un oggetto già presente nella richiesta di cache non ha alcun effetto.

Add(AutomationPattern)

Aggiunge l'identificatore specificato AutomationPattern a questo CacheRequestoggetto .

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)

Parametri

pattern
AutomationPattern

Identificatore che specifica un modello da memorizzare nella cache.

Eccezioni

Esempio

Nell'esempio seguente viene illustrato come costruire un CacheRequest oggetto e aggiungere un modello da memorizzare nella cache.

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)

Commenti

L'aggiunta di un modello già presente nella richiesta di cache non ha alcun effetto.

Vedi anche

Si applica a

Add(AutomationProperty)

Aggiunge l'identificatore specificato AutomationProperty a questo CacheRequestoggetto .

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)

Parametri

property
AutomationProperty

Identificatore che specifica un valore della proprietà da memorizzare nella cache.

Eccezioni

Esempio

Nell'esempio seguente viene illustrato come costruire un CacheRequest oggetto e aggiungere una proprietà da memorizzare nella cache.

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)

Commenti

Quando viene creato un oggetto CacheRequest , l'identificatore RuntimeIdProperty viene aggiunto come proprietà predefinita per la cache.

L'aggiunta di una proprietà già presente nella richiesta di cache non ha alcun effetto.

Vedi anche

Si applica a