AutomationElement.LocalizedControlTypeProperty Campo

Definizione

Identifica la proprietà LocalizedControlType nella lingua dell'utente.

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 

Valore del campo

Esempio

Nell'esempio seguente viene recuperato il valore corrente della proprietà. Il valore predefinito viene restituito se l'elemento non ne fornisce uno.

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

L'esempio seguente recupera il valore corrente della proprietà, ma specifica che se l'elemento stesso non fornisce un valore per la proprietà, NotSupported deve essere restituito anziché un valore predefinito.

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

Commenti

Questo identificatore viene usato dalle applicazioni client Automazione interfaccia utente. Automazione interfaccia utente provider devono usare l'identificatore equivalente in AutomationElementIdentifiers.

Questa proprietà può essere recuperata anche dalle Current proprietà o Cached .

Un provider è necessario per esporre questa proprietà quando rappresenta un controllo personalizzato che non ha un tipo di controllo ben definito.

I valori restituiti della proprietà sono di tipo String. Il valore predefinito per la proprietà è una stringa vuota.

Si applica a

Vedi anche