AutomationElement.OrientationProperty Campo

Definição

Identifica a Orientation propriedade.

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 

Valor de Campo

Exemplos

O exemplo seguinte recupera o valor atual da propriedade. O valor padrão é devolvido se o elemento não fornecer um.

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

O exemplo seguinte recupera o valor atual da propriedade, mas especifica que, se o próprio elemento não fornecer um valor para a propriedade, NotSupported deve ser devolvido em vez de um valor padrão.

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

Observações

Este identificador é utilizado por aplicações clientes de Automatização da Interface de Utilizador. Automatização da Interface de Utilizador fornecedores devem usar o identificador equivalente em AutomationElementIdentifiers.

Esta propriedade também pode ser recuperada das Current propriedades ou.Cached

O valor da propriedade é do tipo OrientationType. O valor predefinido é None.

Aplica-se a

Ver também