Max Depth搜索属性不起作用 [英] Max Depth search property is not working

查看:62
本文介绍了Max Depth搜索属性不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

 我有一个带有树项列表的树视图。当我搜索树视图的根节点时,它花费的时间更少,但是当项目不存在时,搜索引擎花费的时间超过一分钟来显示结果。

 I have a tree view with a list of tree items. When i search for the root node of the tree view, it is taking less time but when the item does not exists the search engine is taking mare than a minute to display the result.

  ; 所以为了最小化搜索,我使用MaxDepth作为1,因为我的兴趣只在树视图的根节点中。我可以看到结果快速显示但总是假的..即使树项存在,exists属性显示
false。

  So in order to minimize the search, i used MaxDepth as 1 since my interest is only in root nodes of the tree view. I could see that result is displayed fastly but always false i.. even though the tree item exists the exist property is showing false.

我的搜索方法更快是否正确?如果不是,我怎样才能缩短搜索时间?我无法缩短搜索时间,因为有时候我可以看到更少的时间找不到控件。

Is my approach of searching faster is correct ? If not how can i reduce the search time? I can't reduce the search time out as sometimes i could see that for less time it is failing to find the control.

为什么最大深度不能正常工作?我尝试将MaxDepth增加到2和3,但仍然失败。

Why is max depth is not working properly ? I tries increasing the MaxDepth to 2 and 3 but still it fails.

提前致谢,

Sumanth

 

 

推荐答案

我假设您正在使用Winforms Tree项目。如果这成立,则Winforms中的树控件在可访问性层上不显示嵌套树结构。所有树项(root,children,leaf ..)都处于同一级别,因此MaxDepth属性将
无法帮助您。

I assume you are working on Winforms Tree item. If this holds true the tree control in Winforms does not exhibit nested tree structure at accessibility layer. All the tree items (root, children, leaf..) will be at the same level so MaxDepth property will not be able to help you here.

您可以使用" ;值"限制搜索的属性,所有根项的值都为"0",第一级子项的值为"1"。

You can use "Value" property to limit your search, all the root items will have value as "0", first level children as "1" and so on.

例如,如果我必须找到树中的所有根项,我可以搜索如下:

For example if I have to find all the root items in a tree, I can search like following:


WinTreeItem rootTreeItem = new WinTreeItem(<<Reference to the tree here>>);

rootTreeItem.SearchProperties["Value"] = "0";

Console.WriteLine(rootTreeItem.FindMatchingControls().Count);


这篇关于Max Depth搜索属性不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆