本文整理汇总了C#中WinWindow.WaitForControlReady方法的典型用法代码示例。如果您正苦于以下问题:C# WinWindow.WaitForControlReady方法的具体用法?C# WinWindow.WaitForControlReady怎么用?C# WinWindow.WaitForControlReady使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WinWindow
的用法示例。
在下文中一共展示了WinWindow.WaitForControlReady方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTable
public static WinTable GetTable(string name, string itemWindowID, WinWindow parent)
{
WinWindow ItemWindow = new WinWindow(parent);
ItemWindow.SearchProperties[WinWindow.PropertyNames.ControlId] = itemWindowID;
ItemWindow.WaitForControlReady();
WinTable mUITable = new WinTable(ItemWindow);
mUITable.SearchProperties[WinTable.PropertyNames.Name] = name;
mUITable.WaitForControlReady();
return mUITable;
}
示例2: SetUIAItemControlValue
public static void SetUIAItemControlValue(string name, string type, string value, WinWindow parent)
{
WinWindow itemWindow = new WinWindow(parent);
itemWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));
itemWindow.WaitForControlReady();
WpfPane pane = new WpfPane(itemWindow);
WpfCustom customControl = new WpfCustom(pane);
customControl.SearchProperties[WpfControl.PropertyNames.ClassName] = "Uia.SegmentedEntry";
customControl.WaitForControlReady();
WpfControl uIControl = new WpfControl(customControl);
uIControl.TechnologyName = "UIA";
uIControl.SearchProperties.Add("ControlType", type);
uIControl.SearchProperties.Add("AutomationId", name);
uIControl.WaitForControlReady();
if (type == "CheckBox")
{
WpfCheckBox mUICheckBox = new WpfCheckBox(uIControl);
mUICheckBox.Checked = Convert.ToBoolean(value);
}
else if (type == "Edit")
{
WpfEdit mUIEdit = new WpfEdit(uIControl);
mUIEdit.Text = value;
}
}
示例3: SetItemControlValue
public static void SetItemControlValue(string name, string type, string value, WinWindow parent)
{
WinWindow ItemWindow = new WinWindow(parent);
ItemWindow.SearchProperties.Add("AccessibleName", name);
ItemWindow.WaitForControlReady();
WinControl uIControl = new WinControl(ItemWindow);
uIControl.TechnologyName = "MSAA";
uIControl.SearchProperties.Add("ControlType", type);
uIControl.SearchProperties.Add("Name", name);
uIControl.WaitForControlReady();
if (type == "CheckBox")
{
WinCheckBox mUICheckBox = new WinCheckBox(uIControl);
mUICheckBox.Checked = Convert.ToBoolean(value);
}
else if (type == "Edit")
{
WinEdit mUIEdit = new WinEdit(uIControl);
mUIEdit.Text = value;
}
}
示例4: GetTreeItemControl
public static WinControl GetTreeItemControl(string name, WinWindow parent)
{
WinWindow treeWindow = new WinWindow(parent);
treeWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.Name, "Tree", PropertyExpressionOperator.Contains));
treeWindow.WaitForControlReady();
WinControl uIControl = new WinControl(treeWindow);
uIControl.SearchProperties.Add("ControlType", "TreeItem");
uIControl.SearchProperties.Add("Name", name);
uIControl.WaitForControlReady();
return uIControl;
}
示例5: GetTabGroupedControl
public static WinControl GetTabGroupedControl(string name, string type, string tabName, string group, WinWindow parent)
{
WinWindow uITab = new WinWindow(parent);
uITab.SearchProperties.Add("ControlName", tabName);
uITab.SearchProperties.Add("ControlType", "Window");
uITab.WaitForControlReady();
WinGroup uIGroup = new WinGroup(uITab);
uIGroup.SearchProperties.Add("Name", group);
uIGroup.WaitForControlReady();
WinControl uIControl = new WinControl(uIGroup);
uIControl.SearchProperties.Add("ControlType", type);
uIControl.SearchProperties.Add("Name", name);
uIControl.WaitForControlReady();
return uIControl;
}
示例6: GetRightClickControl
public static WinControl GetRightClickControl(string name, string type)
{
WinWindow uIWindow = new WinWindow();
uIWindow.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "Context";
uIWindow.SearchProperties[WinWindow.PropertyNames.ClassName] = "#32768";
uIWindow.WaitForControlReady();
WinMenu uIMenu = new WinMenu(uIWindow);
uIMenu.SearchProperties[WinMenu.PropertyNames.Name] = "Context";
uIMenu.WaitForControlReady();
WinControl uIControl = new WinControl(uIMenu);
uIControl.SearchProperties.Add("ControlType", type);
uIControl.SearchProperties.Add("Name", name);
uIControl.WaitForControlReady();
return uIControl;
}
示例7: GetItemWindowControl
public static WinControl GetItemWindowControl(string name, string type, WinWindow parent)
{
WinWindow itemWindow = new WinWindow(parent);
itemWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains));
itemWindow.SearchProperties[WinWindow.PropertyNames.Instance] = "11";
itemWindow.WaitForControlReady();
WinControl uIControl = new WinControl(itemWindow);
uIControl.SearchProperties.Add("ControlType", type);
uIControl.SearchProperties.Add("Name", name);
uIControl.WaitForControlReady();
return uIControl;
}
示例8: GetItemControl
public static WinControl GetItemControl(string name, string type, WinWindow parent)
{
WinWindow ItemWindow = new WinWindow(parent);
ItemWindow.SearchProperties.Add("AccessibleName", name);
ItemWindow.WaitForControlReady();
WinControl uIControl = new WinControl(ItemWindow);
uIControl.SearchProperties.Add("ControlType", type);
uIControl.SearchProperties.Add("Name", name);
uIControl.WaitForControlReady();
return uIControl;
}
示例9: GetDropDownControl
public static WinControl GetDropDownControl(string name, string type, WinWindow parent)
{
WinWindow dropDownWindow = new WinWindow();
dropDownWindow.SearchProperties[WinWindow.PropertyNames.AccessibleName] = "DropDown";
dropDownWindow.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains));
dropDownWindow.WaitForControlReady();
WinMenu menu = new WinMenu(dropDownWindow);
menu.SearchProperties[WinMenu.PropertyNames.Name] = "DropDown";
menu.WaitForControlReady();
WinControl uIControl = new WinControl(menu);
uIControl.SearchProperties.Add("ControlType", type);
uIControl.SearchProperties.Add("Name", name);
uIControl.WaitForControlReady();
return uIControl;
}
示例10: GetTabExists
public bool GetTabExists(string tabName)
{
try
{
WinWindow parentWindow = new UIAXCWindow();
WinWindow itemWindow = new WinWindow(parentWindow);
itemWindow.SearchProperties.Add("Instance", "11");
itemWindow.SearchProperties.Add("ClassName", "WindowsForms10.Window", PropertyExpressionOperator.Contains);
itemWindow.WaitForControlReady();
WinTabList tabList = new WinTabList(itemWindow);
tabList.SearchProperties.Add("ControlType", "TabList");
tabList.WaitForControlReady();
UITestControlCollection tablistChildren = tabList.GetChildren();
int tabListCount = tablistChildren.Count();
for (int i = 0; i <= tabListCount; i++)
{
if ((tablistChildren.ElementAt(i).ControlType.ToString() == "TabPage") && (tablistChildren.ElementAt(i).Name == tabName) && !(tablistChildren.ElementAt(i).State.ToString().Contains("Invisible")))
{
return true;
}
} return false;
}
catch
{
return false;
}
}