AccControl 标记
发布日期: 2016年11月
适用于: Dynamics 365 (online),Dynamics 365 (on-premises),Dynamics CRM 2013,Dynamics CRM 2015,Dynamics CRM 2016
AccControl 标记使用 Microsoft Active Accessibility (MSAA) 的 IAccessible 接口。 AccControl 标记有:
Name 属性可为控件定义用户可访问(友好)名称。
Path 标记可定义应用程序 IAccessibility 树中控件的搜索路径。<Path> 标记包含 FindWindow 标记 和 下一个标记。
以下 XML 示例 显示了使用 AccControl 标记的控件定义。
<AccControl name="Control Name">
<Path>
<FindWindow>
<CaptionStartsWith>Customer App</CaptionStartsWith>
</FindWindow>
<Next/>
<Next match="2">Customer Name:</Next>
</Path>
</AccControl>
备注
Path 标记中的某些元素有 <match> 属性,可用于将计数器添加到搜索说明。 以下两个示例返回相同的搜索结果,但是第一个示例实施 <match> 标记:
示例 1
<Caption match="2">Test Application</Caption>
示例 2:
<Caption>Test Application</Caption>
<Caption>Test Application</Caption>
如果未指定 <match>,默认值为 0。
AccControl 标记上的 GetControlValue 方法总是映射到主题 IAccessible 节点的 get_accValue 方法,除非该节点包含 role="radio button" 或 role="check box"。 在这些情况下,根据是否选择了节点状态,GetControlValue 方法返回 True 或 False。
AccControl 标记上的 SetControlValue 方法总是映射到主题 IAccessible 节点的 set_accValue 方法,除非有 role="radio button" 或 role="check box" 的节点。 对于单选按钮,由于单选按钮不能分派 True 或 False 值,因此引发了 UnsupportedControlOperation 异常。
以下示例显示 <Path> 标记的 RELAX NG XML 代码。
# RELAX NG XML grammar for Path
# http://relaxng.org/compact-tutorial-20030326.html
grammar
{
start = Path
Path = element Path
{
FindWindow* & element Next
{ attribute match { xsd:integer }?
,attribute offset { xsd:integer }?,text? }*
}
}
另请参阅
Unified Service Desk 2.0
© 2017 Microsoft。 保留所有权利。 版权