IRawElementProviderSimple.HostRawElementProvider 屬性

定義

取得這個項目的基底提供者。

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

屬性值

基底提供者或 null

範例

下列範例程式碼顯示 HostRawElementProvider Windows 表單中裝載之片段根目錄的 實作。

IRawElementProviderSimple IRawElementProviderSimple.HostRawElementProvider  
{
    get 
    {
        // myHWND is the handle of the window that contains this control.
        return AutomationInteropProvider.HostProviderFromHandle(myHWND);
    }
}
ReadOnly Property HostRawElementProvider() As IRawElementProviderSimple _
    Implements IRawElementProviderSimple.HostRawElementProvider

    Get
        ' myHWND is the handle of the window that contains this control.
        Return AutomationInteropProvider.HostProviderFromHandle(myHWND)
    End Get
End Property

備註

此屬性是自訂控制項視窗的消費者介面自動化提供者。 消費者介面自動化將此提供者與視窗裝載之控制項的提供者實作搭配使用。 例如,從主機提供者取得專案的執行時間識別碼。

下列任一情況下都必須傳回主機提供者:

  • 這個專案是片段的根目錄。

  • 元素是簡單的元素,例如推播按鈕。

  • 提供者是重新置放預留位置。

在其他情況下,屬性應該會傳回 null

適用於

另請參閱