public AutomationElement FindChild(AutomationProperty searchBy, object value, AutomationElement retrieveControl = null) { var ret = GetControlTileEnable(searchBy, value, false, 30, retrieveControl); if (ret != null) return ret; else throw new ControlNotFoundException(searchBy.ToString() + ":" + value.ToString()); }
private static string GetProgrammaticName (AutomationProperty prop) { if (prop == AEIds.AcceleratorKeyProperty) { return "AcceleratorKeyProperty"; } else if (prop == AEIds.AccessKeyProperty) { return "AccessKeyProperty"; } else if (prop == AEIds.AutomationIdProperty) { return "AutomationIdProperty"; } else if (prop == AEIds.BoundingRectangleProperty) { return "BoundingRectangleProperty"; } else if (prop == AEIds.ClassNameProperty) { return "ClassNameProperty"; } else if (prop == AEIds.ClickablePointProperty) { return "ClickablePointProperty"; } else if (prop == AEIds.ControlTypeProperty) { return "ControlTypeProperty"; } else if (prop == AEIds.HasKeyboardFocusProperty) { return "HasKeyboardFocusProperty"; } else if (prop == AEIds.HelpTextProperty) { return "HelpTextProperty"; } else if (prop == AEIds.IsContentElementProperty) { return "IsContentElementProperty"; } else if (prop == AEIds.IsControlElementProperty) { return "IsControlElementProperty"; } else if (prop == AEIds.IsEnabledProperty) { return "IsEnabledProperty"; } else if (prop == AEIds.IsKeyboardFocusableProperty) { return "IsKeyboardFocusableProperty"; } else if (prop == AEIds.IsOffscreenProperty) { return "IsOffscreenProperty"; } else if (prop == AEIds.IsPasswordProperty) { return "IsPasswordProperty"; } else if (prop == AEIds.IsRequiredForFormProperty) { return "IsRequiredForFormProperty"; } else if (prop == AEIds.ItemStatusProperty) { return "ItemStatusProperty"; } else if (prop == AEIds.ItemTypeProperty) { return "ItemTypeProperty"; } else if (prop == AEIds.LabeledByProperty) { return "LabeledByProperty"; } else if (prop == AEIds.LocalizedControlTypeProperty) { return "LocalizedControlTypeProperty"; } else if (prop == AEIds.NameProperty) { return "NameProperty"; } else if (prop == AEIds.OrientationProperty) { return "OrientationProperty"; } else if (prop == DockPatternIdentifiers.DockPositionProperty) { return "DockPatternIdentifiers.DockPositionProperty"; } else if (prop == ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty) { return "ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty"; } else if (prop == GridItemPatternIdentifiers.ColumnProperty) { return "GridItemPatternIdentifiers.ColumnProperty"; } else if (prop == GridItemPatternIdentifiers.ColumnSpanProperty) { return "GridItemPatternIdentifiers.ColumnSpanProperty"; } else if (prop == GridItemPatternIdentifiers.ContainingGridProperty) { return "GridItemPatternIdentifiers.ContainingGridProperty"; } else if (prop == GridItemPatternIdentifiers.RowProperty) { return "GridItemPatternIdentifiers.RowProperty"; } else if (prop == GridItemPatternIdentifiers.RowSpanProperty) { return "GridItemPatternIdentifiers.RowSpanProperty"; } else if (prop == GridPatternIdentifiers.ColumnCountProperty) { return "GridPatternIdentifiers.ColumnCountProperty"; } else if (prop == GridPatternIdentifiers.RowCountProperty) { return "GridPatternIdentifiers.RowCountProperty"; } else if (prop == MultipleViewPatternIdentifiers.CurrentViewProperty) { return "MultipleViewPatternIdentifiers.CurrentViewProperty"; } else if (prop == MultipleViewPatternIdentifiers.SupportedViewsProperty) { return "MultipleViewPatternIdentifiers.SupportedViewsProperty"; } else if (prop == RangeValuePatternIdentifiers.IsReadOnlyProperty) { return "RangeValuePatternIdentifiers.IsReadOnlyProperty"; } else if (prop == RangeValuePatternIdentifiers.LargeChangeProperty) { return "RangeValuePatternIdentifiers.LargeChangeProperty"; } else if (prop == RangeValuePatternIdentifiers.MaximumProperty) { return "RangeValuePatternIdentifiers.MaximumProperty"; } else if (prop == RangeValuePatternIdentifiers.MinimumProperty) { return "RangeValuePatternIdentifiers.MinimumProperty"; } else if (prop == RangeValuePatternIdentifiers.SmallChangeProperty) { return "RangeValuePatternIdentifiers.SmallChangeProperty"; } else if (prop == RangeValuePatternIdentifiers.ValueProperty) { return "RangeValuePatternIdentifiers.ValueProperty"; } else if (prop == ScrollPatternIdentifiers.HorizontallyScrollableProperty) { return "ScrollPatternIdentifiers.HorizontallyScrollableProperty"; } else if (prop == ScrollPatternIdentifiers.HorizontalScrollPercentProperty) { return "ScrollPatternIdentifiers.HorizontalScrollPercentProperty"; } else if (prop == ScrollPatternIdentifiers.HorizontalViewSizeProperty) { return "ScrollPatternIdentifiers.HorizontalViewSizeProperty"; } else if (prop == ScrollPatternIdentifiers.VerticallyScrollableProperty) { return "ScrollPatternIdentifiers.VerticallyScrollableProperty"; } else if (prop == ScrollPatternIdentifiers.VerticalScrollPercentProperty) { return "ScrollPatternIdentifiers.VerticalScrollPercentProperty"; } else if (prop == ScrollPatternIdentifiers.VerticalViewSizeProperty) { return "ScrollPatternIdentifiers.VerticalViewSizeProperty"; } else if (prop == SelectionItemPatternIdentifiers.IsSelectedProperty) { return "SelectionItemPatternIdentifiers.IsSelectedProperty"; } else if (prop == SelectionItemPatternIdentifiers.SelectionContainerProperty) { return "SelectionItemPatternIdentifiers.SelectionContainerProperty"; } else if (prop == SelectionPatternIdentifiers.CanSelectMultipleProperty) { return "SelectionPatternIdentifiers.CanSelectMultipleProperty"; } else if (prop == SelectionPatternIdentifiers.IsSelectionRequiredProperty) { return "SelectionPatternIdentifiers.IsSelectionRequiredProperty"; } else if (prop == SelectionPatternIdentifiers.SelectionProperty) { return "SelectionPatternIdentifiers.SelectionProperty"; } else if (prop == TableItemPatternIdentifiers.ColumnHeaderItemsProperty) { return "TableItemPatternIdentifiers.ColumnHeaderItemsProperty"; } else if (prop == TableItemPatternIdentifiers.RowHeaderItemsProperty) { return "TableItemPatternIdentifiers.RowHeaderItemsProperty"; } else if (prop == TablePatternIdentifiers.ColumnHeadersProperty) { return "TablePatternIdentifiers.ColumnHeadersProperty"; } else if (prop == TablePatternIdentifiers.RowHeadersProperty) { return "TablePatternIdentifiers.RowHeadersProperty"; } else if (prop == TablePatternIdentifiers.RowOrColumnMajorProperty) { return "TablePatternIdentifiers.RowOrColumnMajorProperty"; } else if (prop == TogglePatternIdentifiers.ToggleStateProperty) { return "TogglePatternIdentifiers.ToggleStateProperty"; } else if (prop == TransformPatternIdentifiers.CanMoveProperty) { return "TransformPatternIdentifiers.CanMoveProperty"; } else if (prop == TransformPatternIdentifiers.CanResizeProperty) { return "TransformPatternIdentifiers.CanResizeProperty"; } else if (prop == TransformPatternIdentifiers.CanRotateProperty) { return "TransformPatternIdentifiers.CanRotateProperty"; } else if (prop == ValuePatternIdentifiers.IsReadOnlyProperty) { return "ValuePatternIdentifiers.IsReadOnlyProperty"; } else if (prop == ValuePatternIdentifiers.ValueProperty) { return "ValuePatternIdentifiers.ValueProperty"; } else if (prop == WindowPatternIdentifiers.CanMaximizeProperty) { return "WindowPatternIdentifiers.CanMaximizeProperty"; } else if (prop == WindowPatternIdentifiers.CanMinimizeProperty) { return "WindowPatternIdentifiers.CanMinimizeProperty"; } else if (prop == WindowPatternIdentifiers.IsModalProperty) { return "WindowPatternIdentifiers.IsModalProperty"; } else if (prop == WindowPatternIdentifiers.IsTopmostProperty) { return "WindowPatternIdentifiers.IsTopmostProperty"; } else if (prop == WindowPatternIdentifiers.WindowInteractionStateProperty) { return "WindowPatternIdentifiers.WindowInteractionStateProperty"; } else if (prop == WindowPatternIdentifiers.WindowVisualStateProperty) { return "WindowPatternIdentifiers.WindowVisualStateProperty"; } else { return prop.ToString (); } }