共用方式為


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

屬性值

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 提供者應該會傳回本身。

適用於

另請參閱