当前位置: 首页>>代码示例>>C#>>正文


C# AutomationElement.TryGetClickablePoint方法代码示例

本文整理汇总了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));
     }
 }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:13,代码来源:stress.cs

示例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++;
        }
开发者ID:TestStack,项目名称:UIAVerify,代码行数:20,代码来源:ExpandCollapseTests.cs

示例3: TryGetClickablePoint

 internal static bool TryGetClickablePoint(AutomationElement element, out Point point)
 {
     return element.TryGetClickablePoint(out point);
 }
开发者ID:horst14,项目名称:Winium.Cruciatus,代码行数:4,代码来源:AutomationElementHelper.cs

示例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);
            }
        }
开发者ID:jeffras,项目名称:uiverify,代码行数:13,代码来源:AutomationElementTreeControl.cs

示例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++;
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:17,代码来源:InvokeTests.cs


注:本文中的System.Windows.Automation.AutomationElement.TryGetClickablePoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。