AutomationElement.NameProperty フィールド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Name プロパティを識別します。
public: static initonly System::Windows::Automation::AutomationProperty ^ NameProperty;
public static readonly System.Windows.Automation.AutomationProperty NameProperty;
staticval mutable NameProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly NameProperty As AutomationProperty
フィールド値
例
次の例では、プロパティの現在の値を取得します。 要素に既定値が指定されていない場合は、既定値が返されます。
string nameProp =
autoElement.GetCurrentPropertyValue(AutomationElement.NameProperty) as string;
Dim nameProp As String = _
CStr(autoElement.GetCurrentPropertyValue(AutomationElement.NameProperty))
次の例では、プロパティの現在の値を取得しますが、要素自体がプロパティの値を提供しない場合は、既定値ではなく NotSupported を返すように指定します。
string nameProp1;
object namePropNoDefault =
autoElement.GetCurrentPropertyValue(AutomationElement.NameProperty, true);
if (namePropNoDefault == AutomationElement.NotSupported)
{
nameProp1 = "No name.";
}
else
{
nameProp1 = namePropNoDefault as string;
}
Dim nameProp1 As String
Dim namePropNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.NameProperty, True)
If namePropNoDefault Is AutomationElement.NotSupported Then
nameProp1 = "No name."
Else
nameProp1 = CStr(namePropNoDefault)
End If
注釈
この識別子は、クライアント アプリケーションUI オートメーション使用されます。 UI オートメーションプロバイダーは、AutomationElementIdentifiers で同等の識別子を使用する必要があります。
このプロパティは、 Current または Cached プロパティから取得することもできます。
プロパティの戻り値は、 String型です。 プロパティの既定値は空の文字列です。