Språk

AutomationElement.LocalizedControlTypeProperty Fält

Definition

Identifierar egenskapen LocalizedControlType på det lokala språket.

public: static initonly System::Windows::Automation::AutomationProperty ^ LocalizedControlTypeProperty;
public static readonly System.Windows.Automation.AutomationProperty LocalizedControlTypeProperty;
 staticval mutable LocalizedControlTypeProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly LocalizedControlTypeProperty As AutomationProperty 

Fältvärde

Exempel

I följande exempel hämtas det aktuella värdet för egenskapen. Standardvärdet returneras om elementet inte tillhandahåller något.

string localizedType =
    autoElement.GetCurrentPropertyValue(AutomationElement.LocalizedControlTypeProperty) as string;
Dim localizedType As String = _
    Cstr(autoElement.GetCurrentPropertyValue(AutomationElement.LocalizedControlTypeProperty))

I följande exempel hämtas det aktuella värdet för egenskapen, men anger att om själva elementet inte tillhandahåller något värde för egenskapen NotSupported , returneras i stället för ett standardvärde.

string localizedType1;
object localizedTypeNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.LocalizedControlTypeProperty, true);
if (localizedTypeNoDefault == AutomationElement.NotSupported)
{
    localizedType1 = "Unknown type.";
}
else
{
    localizedType1 = localizedTypeNoDefault as string;
}
Dim localizedType1 As String
Dim localizedTypeNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.LocalizedControlTypeProperty, True)
If localizedTypeNoDefault Is AutomationElement.NotSupported Then
    localizedType1 = "Unknown type."
Else
    localizedType1 = CStr(localizedTypeNoDefault)
End If

Kommentarer

Den här identifieraren används av UI Automation klientprogram. UI Automation providers bör använda motsvarande identifierare i AutomationElementIdentifiers.

Den här egenskapen kan också hämtas från Current egenskaperna eller Cached .

En provider måste exponera den här egenskapen när den representerar en anpassad kontroll som inte har en väldefinierad kontrolltyp.

Returvärden för egenskapen är av typen String. Standardvärdet för egenskapen är en tom sträng.

Gäller för

Se även