Język

AutomationElement.ItemStatusProperty Pole

Definicja

ItemStatus Identyfikuje właściwość, która określa stan wizualnej reprezentacji złożonego elementu.

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 

Wartość pola

Przykłady

Poniższy przykład pobiera bieżącą wartość właściwości. Wartość domyślna jest zwracana, jeśli element go nie podaje.

string itemStatus =
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty) as string;
Dim itemStatus As String = _
    CStr(autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty))

Poniższy przykład pobiera bieżącą wartość właściwości, ale określa, że jeśli sam element nie podaje wartości dla właściwości, NotSupported ma zostać zwrócona zamiast wartości domyślnej.

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

Uwagi

Ten identyfikator jest używany przez aplikacje klienckie automatyzacja interfejsu użytkownika. automatyzacja interfejsu użytkownika dostawcy powinni użyć równoważnego identyfikatora w AutomationElementIdentifiers.

Wartość zwracana jest zdefiniowaną Stringprzez kontrolkę . Wartość domyślna to pusty ciąg.

Dotyczy

Zobacz też