AutomationElement.ItemStatusProperty Pole

Definicja

Identyfikuje ItemStatus 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 nie podaje go.

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 właściwości, NotSupported należy zwrócić 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 pliku AutomationElementIdentifiers.

Wartość zwracana jest zdefiniowaną przez Stringkontrolkę . Wartością domyślną jest ciąg pusty.

Dotyczy

Zobacz też