AutomationElement.OrientationProperty Campo

Definizione

Identifica la proprietà Orientation.

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 

Valore del campo

Esempio

Nell'esempio seguente viene recuperato il valore corrente della proprietà. Il valore predefinito viene restituito se l'elemento non ne fornisce uno.

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

L'esempio seguente recupera il valore corrente della proprietà, ma specifica che se l'elemento stesso non fornisce un valore per la proprietà, NotSupported deve essere restituito anziché un valore predefinito.

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

Commenti

Questo identificatore viene usato dalle applicazioni client Automazione interfaccia utente. Automazione interfaccia utente provider devono usare l'identificatore equivalente in AutomationElementIdentifiers.

Questa proprietà può essere recuperata anche dalle Current proprietà o Cached .

Il valore della proprietà è di tipo OrientationType. Il valore predefinito è None.

Si applica a

Vedi anche