Assembly: UIAutomationClient (in uiautomationclient.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
Retrieving properties and patterns through UI Automation requires cross-process calls that can slow down performance. By caching values of proprieties and patterns in a batch operation, you can enhance the performance of your application.
Create a new cache request by calling the class constructor. The request is populated by repeated calls to the Add method.
Only a single CacheRequest can be active. There are two ways to activate a request:
Call Activate on the request. This pushes the request onto the stack, and the request is popped when the object is disposed. To ensure disposal even if an exception is raised, use the return value from Activate within a using block (Using in Microsoft Visual Basic .NET).
Put the request onto the internal stack by calling Push. Only the topmost request on the stack is active, and it must be the next one removed from the stack by Pop. Popping the request deactivates it.
UI Automation elements obtained while the request is active will have cached values for the properties and patterns specified.
The following example shows how to use Activate to cache patterns and properties.
The following example shows how to use Push and Pop to cache patterns and properties.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.