本文整理汇总了C#中System.Windows.Automation.CacheRequest.GetUiaCacheRequest方法的典型用法代码示例。如果您正苦于以下问题:C# CacheRequest.GetUiaCacheRequest方法的具体用法?C# CacheRequest.GetUiaCacheRequest怎么用?C# CacheRequest.GetUiaCacheRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Automation.CacheRequest
的用法示例。
在下文中一共展示了CacheRequest.GetUiaCacheRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Normalize
internal AutomationElement Normalize(Condition condition, CacheRequest request )
{
CheckElement();
UiaCoreApi.UiaCacheRequest cacheRequest;
if (request == null)
cacheRequest = CacheRequest.DefaultUiaCacheRequest;
else
cacheRequest = request.GetUiaCacheRequest();
// Normalize against the treeview condition, not the one in the cache request...
UiaCoreApi.UiaCacheResponse response = UiaCoreApi.UiaGetUpdatedCache(_hnode, cacheRequest, UiaCoreApi.NormalizeState.Custom, condition);
return CacheHelper.BuildAutomationElementsFromResponse(cacheRequest, response);
}
示例2: GetUpdatedCache
/// <summary>
/// Get an AutomationElement with updated cached values
/// </summary>
/// <param name="request">CacheRequest object describing the properties and other information to fetch</param>
/// <returns>Returns a new AutomationElement, which refers to the same UI as this element, but which is
/// populated with properties specified in the CacheRequest.</returns>
/// <remarks>
/// Unlike other methods, such as FromHandle, FromPoint, this method takes
/// an explicit CacheRequest as a parameter, and ignores the currently
/// active CacheRequest.
/// </remarks>
public AutomationElement GetUpdatedCache(CacheRequest request)
{
Misc.ValidateArgumentNonNull(request, "request");
CheckElement();
UiaCoreApi.UiaCacheRequest cacheRequest = request.GetUiaCacheRequest();
// Don't normalize when getting updated cache...
UiaCoreApi.UiaCacheResponse response = UiaCoreApi.UiaGetUpdatedCache(_hnode, cacheRequest, UiaCoreApi.NormalizeState.None, null);
return CacheHelper.BuildAutomationElementsFromResponse(cacheRequest, response);
}
示例3: Navigate
// Called by the treewalker classes to navigate - we call through to the
// provider wrapper, which gets the navigator code to do its stuff
internal AutomationElement Navigate(NavigateDirection direction, Condition condition, CacheRequest request)
{
CheckElement();
UiaCoreApi.UiaCacheRequest cacheRequest;
if (request == null)
cacheRequest = CacheRequest.DefaultUiaCacheRequest;
else
cacheRequest = request.GetUiaCacheRequest();
UiaCoreApi.UiaCacheResponse response = UiaCoreApi.UiaNavigate(_hnode, direction, condition, cacheRequest);
return CacheHelper.BuildAutomationElementsFromResponse(cacheRequest, response);
}