AutomationElement.OrientationProperty Pole

Definice

Identifikuje Orientation vlastnost .

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 

Hodnota pole

Příklady

Následující příklad načte aktuální hodnotu vlastnosti . Pokud element hodnotu neposkytuje, vrátí se výchozí hodnota.

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

Následující příklad načte aktuální hodnotu vlastnosti, ale určuje, že pokud samotný prvek neposkytuje hodnotu pro vlastnost, NotSupported bude vrácena místo výchozí hodnoty.

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

Poznámky

Tento identifikátor používají klientské aplikace automatizace uživatelského rozhraní. Zprostředkovatelé automatizace uživatelského rozhraní by měli používat ekvivalentní identifikátor v AutomationElementIdentifiersnástroji .

Tuto vlastnost lze také načíst z Current vlastností nebo Cached .

Hodnota vlastnosti je typu OrientationType. Výchozí hodnota je None.

Platí pro

Viz také