AutomationElement.OrientationProperty Feld

Definition

Identifies the Orientation property.

public: static initonly System::Windows::Automation::AutomationProperty ^ OrientationProperty;
public static readonly System.Windows.Automation.AutomationProperty OrientationProperty;
 staticval mutable OrientationProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly OrientationProperty As AutomationProperty 

Feldwert

Beispiele

Im folgenden Beispiel wird der aktuelle Wert der Eigenschaft abgerufen. Der Standardwert wird zurückgegeben, wenn das Element kein Element bereitstellt.

OrientationType orientationType = (OrientationType)
    autoElement.GetCurrentPropertyValue(AutomationElement.OrientationProperty);
Dim orientationType As OrientationType = _
    DirectCast(autoElement.GetCurrentPropertyValue(AutomationElement.OrientationProperty), _
    OrientationType)

Das folgende Beispiel ruft den aktuellen Wert der Eigenschaft ab, gibt jedoch an, dass, wenn das Element selbst keinen Wert für die Eigenschaft bereitstellt, NotSupported anstelle eines Standardwerts zurückgegeben werden soll.

OrientationType orientationType1;
object orientationTypeNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.OrientationProperty, true);
if (orientationTypeNoDefault == AutomationElement.NotSupported)
{
    // TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
    orientationType1 = (OrientationType)orientationTypeNoDefault;
}
Dim orientationType1 As OrientationType
Dim orientationTypeNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.OrientationProperty, True)
If orientationTypeNoDefault Is AutomationElement.NotSupported Then
    ' TODO Handle the case where you do not wish to proceed using the default value.
Else
    orientationType1 = DirectCast(orientationTypeNoDefault, OrientationType)
End If

Hinweise

Dieser Bezeichner wird von Benutzeroberflächenautomatisierung Clientanwendungen verwendet. Benutzeroberflächenautomatisierung Anbieter sollten den entsprechenden Bezeichner in AutomationElementIdentifiers verwenden.

Diese Eigenschaft kann auch aus den Current Eigenschaften abgerufen Cached werden.

Der Wert der Eigenschaft ist vom Typ OrientationType. Der Standardwert ist None.

Gilt für:

Weitere Informationen