Linguaggio

AutomationElement.ItemStatusProperty Campo

Definizione

Identifica la ItemStatus proprietà , che specifica lo stato della rappresentazione visiva di un elemento complesso.

public: static initonly System::Windows::Automation::AutomationProperty ^ ItemStatusProperty;
public static readonly System.Windows.Automation.AutomationProperty ItemStatusProperty;
 staticval mutable ItemStatusProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly ItemStatusProperty 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 itemStatus =
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty) as string;
Dim itemStatus As String = _
    CStr(autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty))

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

string itemStatus1;
object itemStatusNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty, true);
if (itemStatusNoDefault == AutomationElement.NotSupported)
{
    // TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
    itemStatus1 = itemStatusNoDefault as string;
}
Dim itemStatus1 As String
Dim itemStatusNoDefault As Object = _
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty, True)
If itemStatusNoDefault Is AutomationElement.NotSupported Then
    ' TODO Handle the case where you do not wish to proceed using the default value.
Else
    itemStatus1 = CStr(itemStatusNoDefault)
End If

Commenti

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

Il valore restituito è un oggetto definito dal Stringcontrollo . Il valore predefinito è una stringa vuota.

Si applica a

Vedi anche