AutomationElement.ItemStatusProperty Fält
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Identifierar egenskapen ItemStatus , som anger status för den visuella representationen av ett komplext objekt.
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
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 itemStatus =
autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty) as string;
Dim itemStatus As String = _
CStr(autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty))
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 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
Kommentarer
Den här identifieraren används av UI Automation klientprogram. UI Automation providers bör använda motsvarande identifierare i AutomationElementIdentifiers.
Returvärdet är en kontrolldefinierad String. Standardvärdet är en tom sträng.