IRawElementProviderFragment.FragmentRoot 属性

定义

检索该片段的根节点。

public:
 property System::Windows::Automation::Provider::IRawElementProviderFragmentRoot ^ FragmentRoot { System::Windows::Automation::Provider::IRawElementProviderFragmentRoot ^ get(); };
public System.Windows.Automation.Provider.IRawElementProviderFragmentRoot FragmentRoot { get; }
member this.FragmentRoot : System.Windows.Automation.Provider.IRawElementProviderFragmentRoot
Public ReadOnly Property FragmentRoot As IRawElementProviderFragmentRoot

属性值

根节点

示例

下面的代码示例演示片段中元素的实现,例如列表框中的列表项。

/// <summary>
/// Gets the root of this fragment.
/// </summary>
/// <remarks>
/// parentControl is the automation provider for the root fragment. In other cases,
/// the parent element might not be the root.
/// </remarks>
public IRawElementProviderFragmentRoot FragmentRoot
{
    get
    {
        return (IRawElementProviderFragmentRoot)parentControl;
    }
}
''' <summary>
''' Gets the root of this fragment.
''' </summary>
''' <remarks>
''' parentControl is the automation provider for the root fragment. In other cases,
''' the parent element might not be the root.
''' </remarks>

Public ReadOnly Property FragmentRoot() As IRawElementProviderFragmentRoot _
    Implements IRawElementProviderFragment.FragmentRoot

    Get
        Return DirectCast(parentControl, IRawElementProviderFragmentRoot)
    End Get
End Property

注解

实现 的 IRawElementProviderFragmentRoot 提供程序应返回自身。

适用于

另请参阅