TransformPattern.CanRotateProperty Field
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Identifies the CanRotate property.
public: static initonly System::Windows::Automation::AutomationProperty ^ CanRotateProperty;
public static readonly System.Windows.Automation.AutomationProperty CanRotateProperty;
staticval mutable CanRotateProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly CanRotateProperty As AutomationProperty
Field Value
Examples
In the following example, a root element is passed to a function that returns a collection of UI Automation elements that are descendants of the root and satisfy a set of property conditions.
///--------------------------------------------------------------------
/// <summary>
/// Finds all automation elements that satisfy
/// the specified condition(s).
/// </summary>
/// <param name="rootElement">
/// The automation element from which to start searching.
/// </param>
/// <returns>
/// A collection of automation elements satisfying
/// the specified condition(s).
/// </returns>
///--------------------------------------------------------------------
private AutomationElementCollection FindAutomationElement(
AutomationElement rootElement)
{
if (rootElement == null)
{
throw new ArgumentException("Root element cannot be null.");
}
PropertyCondition conditionCanMove =
new PropertyCondition(TransformPattern.CanMoveProperty, false);
PropertyCondition conditionCanResize =
new PropertyCondition(TransformPattern.CanResizeProperty, true);
PropertyCondition conditionCanRotate =
new PropertyCondition(TransformPattern.CanRotateProperty, true);
// Use any combination of the preceding condtions to
// find the control(s) of interest
Condition condition = new AndCondition(
conditionCanRotate,
conditionCanMove,
conditionCanResize);
return rootElement.FindAll(TreeScope.Descendants, condition);
}
'''--------------------------------------------------------------------
''' <summary>
''' Finds all automation elements that satisfy
''' the specified condition(s).
''' </summary>
''' <param name="rootElement">
''' The automation element from which to start searching.
''' </param>
''' <returns>
''' A collection of automation elements satisfying
''' the specified condition(s).
''' </returns>
'''--------------------------------------------------------------------
Private Function FindAutomationElement( _
ByVal rootElement As AutomationElement) As AutomationElementCollection
If rootElement Is Nothing Then
Throw New ArgumentException("Root element cannot be null.")
End If
Dim conditionCanMove As New PropertyCondition( _
TransformPattern.CanMoveProperty, False)
Dim conditionCanResize As New PropertyCondition( _
TransformPattern.CanResizeProperty, True)
Dim conditionCanRotate As New PropertyCondition( _
TransformPattern.CanRotateProperty, True)
' Use any combination of the preceding condtions to
' find the control(s) of interest
Dim condition As AndCondition = New AndCondition( _
conditionCanRotate, conditionCanMove, conditionCanResize)
Return rootElement.FindAll(TreeScope.Descendants, condition)
End Function 'FindAutomationElement
Remarks
This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent field in TransformPatternIdentifiers.
Applies to
Surađujte s nama na GitHubu
Izvor za ovaj sadržaj možete pronaći na GitHubu, gdje možete stvarati i pregledavati probleme i zahtjeve za povlačenjem. Dodatne informacije potražite u našem vodiču za suradnike.