Export (0) Print
Expand All

DockPattern.DockPositionProperty Field

Identifies the DockPosition property.

Namespace: System.Windows.Automation
Assembly: UIAutomationClient (in uiautomationclient.dll)

public static readonly AutomationProperty DockPositionProperty
public static final AutomationProperty DockPositionProperty
public static final var DockPositionProperty : AutomationProperty
Not applicable.

This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent field in DockPatternIdentifiers.

This property can also be retrieved from the Current or Cached properties.

The default value is None.

In the following example, a DockPosition value is obtained representing the current dock position for a control that supports DockPattern.

    ///--------------------------------------------------------------------
    /// <summary>
    /// Finds all automation elements that satisfy 
    /// the specified condition(s).
    /// </summary>
    /// <param name="targetApp">
    /// 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 targetApp)
    {
        if (targetApp == null)
        {
            throw new ArgumentException("Root element cannot be null.");
        }

        PropertyCondition conditionSupportsDock =
            new PropertyCondition(
            AutomationElement.IsDockPatternAvailableProperty, true);

        return targetApp.FindAll(
            TreeScope.Descendants, conditionSupportsDock);
    }

...

    ///--------------------------------------------------------------------
    /// <summary>
    /// Gets the current DockPosition of a target.
    /// </summary>
    /// <param name="dockControl">
    /// The automation element of interest.
    /// </param>
    /// <returns>
    /// The current dock position.
    /// </returns>
    ///--------------------------------------------------------------------
    private DockPosition GetCurrentDockPosition(
        AutomationElement dockControl)
    {
        if (dockControl == null)
        {
            throw new ArgumentNullException(
                "AutomationElement parameter must not be null.");
        }

        return (DockPosition)dockControl.GetCurrentPropertyValue(
            DockPattern.DockPositionProperty);
    }

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft