示例#1
0
 void LoadSimpleChildren(SystemAccessible item)
 {
     for (int i = 1, n = item.GetChildCount(); i <= n; i++)
     {
         SystemAccessible child = (SystemAccessible)item.GetChild(i);
         AddChild(child);
     }
 }
示例#2
0
        void AddChild(SystemAccessible child)
        {
            string name = child.Name;

            if (!string.IsNullOrEmpty(name) && child.Role != AccessibleRole.Window)
            {
                Trace.WriteLine("Found: " + name);
                if (!map.ContainsKey(name) || child.Role == AccessibleRole.Client)
                {
                    map[name] = child;
                }
                else
                {
                    Trace.WriteLine(string.Format("Ambiguous item name: '{0}'", name));
                }
            }
            if (child.GetChildCount() > 0)
            {
                LoadChildren(child);
            }
        }