IRawElementProviderSimple.GetPropertyValue(Int32) メソッド      
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
UI オートメーション プロバイダーでサポートされるプロパティの値を取得します。
public:
 System::Object ^ GetPropertyValue(int propertyId);public object GetPropertyValue(int propertyId);abstract member GetPropertyValue : int -> objPublic Function GetPropertyValue (propertyId As Integer) As Objectパラメーター
- propertyId
- Int32
プロパティの識別子。
戻り値
プロパティの値か、null か (このプロバイダーでプロパティがサポートされていない場合)、NotSupported (まったくサポートされていない場合)。
例
次のコード例は、カスタム ボタン コントロールの の GetPropertyValue 実装を示しています。
object IRawElementProviderSimple.GetPropertyValue(int propertyId)
{
    if (propertyId == AutomationElementIdentifiers.NameProperty.Id)
    {
        return "RootButtonControl";
    }
    else if (propertyId == AutomationElementIdentifiers.ClassNameProperty.Id)
    {
        return "RootButtonControlClass";
    }
    else if (propertyId == AutomationElementIdentifiers.ControlTypeProperty.Id)
    {
        return ControlType.Button.Id;  
    }
    else if (propertyId == AutomationElementIdentifiers.IsContentElementProperty.Id)
    {
        return false;
    }
    else if (propertyId == AutomationElementIdentifiers.IsControlElementProperty.Id)
    {
        return true;
    }
    else
    {
        return null;
    }
}
Function GetPropertyValue(ByVal propertyId As Integer) As Object _
    Implements IRawElementProviderSimple.GetPropertyValue
    If propertyId = AutomationElementIdentifiers.NameProperty.Id Then
        Return "RootButtonControl"
    ElseIf propertyId = AutomationElementIdentifiers.ClassNameProperty.Id Then
        Return "RootButtonControlClass"
    ElseIf propertyId = AutomationElementIdentifiers.ControlTypeProperty.Id Then
        Return ControlType.Button.Id
    ElseIf propertyId = AutomationElementIdentifiers.IsContentElementProperty.Id Then
        Return False
    ElseIf propertyId = AutomationElementIdentifiers.IsControlElementProperty.Id Then
        Return True
    Else
        Return Nothing
    End If
End Function 'IRawElementProviderSimple.GetPropertyValue
注釈
プロバイダーは、プロパティ値を明示的に非表示にしていて、要求が他のプロバイダーに渡されない場合にのみを返 NotSupported す必要があります。