本文整理汇总了C#中System.Windows.Automation.AutomationElement.TryGetClickablePoint方法的典型用法代码示例。如果您正苦于以下问题:C# AutomationElement.TryGetClickablePoint方法的具体用法?C# AutomationElement.TryGetClickablePoint怎么用?C# AutomationElement.TryGetClickablePoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Automation.AutomationElement
的用法示例。
在下文中一共展示了AutomationElement.TryGetClickablePoint方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutomationElementTryGetClickablePoint
public static void AutomationElementTryGetClickablePoint(AutomationElement element)
{
Dump("TryGetClickablePoint()", true, element);
Point pt = new Point();
try
{
object obj = element.TryGetClickablePoint(out pt);
}
catch (Exception exception)
{
VerifyException(element, exception, typeof(ElementNotAvailableException));
}
}
示例2: TS_VerifyElementIsOnScreenAndNotOverlapped
/// -------------------------------------------------------------------
/// <summary>
/// Check the IsOffScreen property, and that FromPoint(pt) == element where point
/// was obtained from TryClickablePoint
/// </summary>
/// -------------------------------------------------------------------
private void TS_VerifyElementIsOnScreenAndNotOverlapped(AutomationElement element, CheckType checkType)
{
if (true == element.Current.IsOffscreen)
ThrowMe(checkType, "IsOffScreen == true");
Point pt = new Point();
if (false == element.TryGetClickablePoint(out pt))
ThrowMe(checkType, "TryGetClickablePoint() returned false");
if (false == Automation.Compare(element, AutomationElement.FromPoint(pt)))
ThrowMe(checkType, "Could not get element from pt{0}, could the element be covered by another window?", pt);
m_TestStep++;
}
示例3: TryGetClickablePoint
internal static bool TryGetClickablePoint(AutomationElement element, out Point point)
{
return element.TryGetClickablePoint(out point);
}
示例4: SnapMouseToClickablePoint
/// <summary>
/// This method will snap mouse cursor to element's clickable point.
/// </summary>
public void SnapMouseToClickablePoint(AutomationElement element)
{
Point clickablePoint;
if (element.TryGetClickablePoint(out clickablePoint))
{
this.Cursor = new Cursor(Cursor.Current.Handle);
Cursor.Position = new System.Drawing.Point((int)clickablePoint.X, (int)clickablePoint.Y);
}
}
示例5: TSC_MouseClick
/// -------------------------------------------------------------------
/// <summary></summary>
/// -------------------------------------------------------------------
internal void TSC_MouseClick(AutomationElement element, CheckType checkType) //Point pt, string varPt, CheckType ct)
{
Point pt = new Point();
if (!element.TryGetClickablePoint(out pt))
{
ThrowMe(checkType, "TryGetClickablePoint returned false");
}
Comment("Calling Performing mouse click @ Point(" + pt + ")");
ATGTestInput.Input.MoveToAndClick(pt);
m_TestStep++;
}