WpfText 类

表示用于测试 Windows Presentation Foundation (WPF) 应用程序用户界面 (UI) 的文本控件。

继承层次结构

System.Object
  Microsoft.VisualStudio.TestTools.UITesting.UITestControl
    Microsoft.VisualStudio.TestTools.UITesting.WpfControls.WpfControl
      Microsoft.VisualStudio.TestTools.UITesting.WpfControls.WpfText

命名空间:  Microsoft.VisualStudio.TestTools.UITesting.WpfControls
程序集:  Microsoft.VisualStudio.TestTools.UITesting(在 Microsoft.VisualStudio.TestTools.UITesting.dll 中)

语法

声明
Public Class WpfText _
    Inherits WpfControl
public class WpfText : WpfControl
public ref class WpfText : public WpfControl
type WpfText =  
    class
        inherit WpfControl
    end
public class WpfText extends WpfControl

WpfText 类型公开以下成员。

构造函数

  名称 说明
公共方法 WpfText() 初始化 WpfText 类的新实例。
公共方法 WpfText(UITestControl) 使用所提供的父控件初始化 WpfText 类的新实例。

页首

属性

  名称 说明
公共属性 AcceleratorKey 获取分配给此控件的键盘快捷键。 (继承自 WpfControl。)
公共属性 AccessKey 获取分配给此控件的键盘快捷键。 (继承自 WpfControl。)
公共属性 AutomationId 获取分配给此控件的自动化 ID。 (继承自 WpfControl。)
公共属性 BoundingRectangle 获取此控件的边框。 (继承自 UITestControl。)
公共属性 ClassName 获取此控件的类名。 (继承自 UITestControl。)
公共属性 Container 获取或设置此 UITestControl 的容器。 (继承自 UITestControl。)
公共属性 ControlType 获取 UI 控件的类型。 (继承自 UITestControl。)
公共属性 DisplayText 获取此文本控件的显示文本。
公共属性 Enabled 获取一个值,该值指示是否启用此控件。 (继承自 UITestControl。)
公共属性 Exists 获取一个值,该值指示此控件是否存在于用户界面中。 (继承自 UITestControl。)
公共属性 FilterProperties 获取用于消除控件歧义的属性-值对集合。 (继承自 UITestControl。)
公共属性 Font 获取此控件的文本部分的字体名称。 (继承自 WpfControl。)
公共属性 FriendlyName 获取该控件在用户接口中的名称。 (继承自 UITestControl。)
公共属性 HasFocus 获取指示此控件当前是否在用户界面中有焦点的值。 (继承自 UITestControl。)
公共属性 HelpText 获取分配给此控件的帮助文本。 (继承自 WpfControl。)
公共属性 IsTopParent 获取指示此控件是否是顶级元素的值。 (继承自 UITestControl。)
公共属性 LabeledBy 获取此控件的标签文本。 (继承自 WpfControl。)
公共属性 Name 获取此控件的名称。 (继承自 UITestControl。)
公共属性 NativeElement 获取与此控件对应的本机技术元素。 (继承自 UITestControl。)
公共属性 SearchConfigurations 获取或设置搜索配置。 (继承自 UITestControl。)
公共属性 SearchProperties 获取用于标识控件的属性-值对集合。 (继承自 UITestControl。)
受保护的属性 SearchPropertiesSetExplicitly 获取指示控件的查找属性是否在用户接口中被用户设定的值。 (继承自 UITestControl。)
公共属性 TechnologyName 获取或设置实现此控件的技术框架。 (继承自 UITestControl。)
公共属性 TopParent 获取此控件的顶级父级。 (继承自 UITestControl。)
公共属性 WindowHandle 获取此控件的窗口句柄。 (继承自 UITestControl。)
公共属性 WindowTitles 获取顶层窗口的窗口标题的集合。 (继承自 UITestControl。)

页首

方法

  名称 说明
公共方法 CaptureImage 捕获 UITestControl 的图像。UITestControl 必须显示在屏幕上。 (继承自 UITestControl。)
公共方法 CopyFrom 创建一个 UITestControl 对象,该对象与原始 UITestControl 引用相同的用户界面元素。 (继承自 UITestControl。)
公共方法 DrawHighlight 突出显示控件。 (继承自 UITestControl。)
公共方法 EnsureClickable() 滚动用户界面以确保控件可单击。 (继承自 UITestControl。)
公共方法 EnsureClickable(Point) 将用户界面滚动到特定点,以确保控件可单击。 (继承自 UITestControl。)
公共方法 Equals 确定指定的 UITestControl 是否等于当前的 UITestControl。 (继承自 UITestControl。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 Find 查找 UITestControl。 (继承自 UITestControl。)
公共方法 FindMatchingControls 返回与指定 SearchPropertiesFilterProperties 匹配的所有 UITestControl 的集合。 (继承自 UITestControl。)
公共方法 GetChildren 返回当前 UITestControl 的所有第一级子级的集合。 (继承自 UITestControl。)
公共方法 GetClickablePoint 返回控件上可单击的点。 (继承自 UITestControl。)
公共方法 GetHashCode 返回一个唯一值,表示当前 UITestControl 实例。 (继承自 UITestControl。)
公共方法 GetParent 返回当前 UITestControl 的父级。 (继承自 UITestControl。)
公共方法 GetProperty 获取指定属性的值。 (继承自 UITestControl。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
受保护的方法 GetUITestControlsForSearch 获取此控件中的子控件数组。 (继承自 WpfControl。)
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 SetFocus 将键盘焦点设置到 UITestControl。 (继承自 UITestControl。)
公共方法 SetProperty 设置给定属性的值。 (继承自 UITestControl。)
公共方法 ToString 返回表示当前 UITestControl 的字符串。 (继承自 UITestControl。)
公共方法 TryGetClickablePoint 返回 UITestControl 中的可单击点。如果不可单击该控件,则此方法返回 false。 (继承自 UITestControl。)
公共方法 WaitForControlCondition(Predicate<UITestControl>) 阻止当前线程,直到此控件满足指定条件或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlCondition(Predicate<UITestControl>, Int32) 阻止当前线程,直到此控件满足指定条件或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlEnabled() 阻止当前线程,直到启用此控件或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlEnabled(Int32) 阻止当前线程,直到启用此控件或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlExist() 阻止当前线程,直到用户界面中出现此控件,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlExist(Int32) 阻止当前线程,直到用户界面中出现此控件,或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlNotExist() 阻止当前线程,直到用户界面中不再存在此控件,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlNotExist(Int32) 阻止当前线程,直到用户界面中不再存在此控件,或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlPropertyEqual(String, Object) 阻止当前线程,直到此控件的指定属性等于指定值,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlPropertyEqual(String, Object, Int32) 阻止当前线程,直到此控件的指定属性等于指定值,或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlPropertyNotEqual(String, Object) 阻止当前线程,直到此控件的指定属性不等于指定值,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlPropertyNotEqual(String, Object, Int32) 阻止当前线程,直到此控件的指定属性不等于指定值,或直到指定超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlReady() 阻止当前线程,直到此控件准备好接收受鼠标或键盘输入,或直到默认超时时间已到。 (继承自 UITestControl。)
公共方法 WaitForControlReady(Int32) 阻止当前线程,直到此控件准备好接收受鼠标或键盘输入,或直到指定超时时间已到。 (继承自 UITestControl。)

页首

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.VisualStudio.TestTools.UITesting.WpfControls 命名空间

WpfText.PropertyNames

WpfControl