Class UiaFlavorElement
public class UiaFlavorElement : FlavorElement
- Inheritance
-
UiaFlavorElement
- Derived
- Inherited Members
Constructors
UiaFlavorElement(AutomationElement, UiaWindowFlavorElement)
public UiaFlavorElement(AutomationElement uiElement, UiaWindowFlavorElement topLevelAncestor)
Parameters
uiElementAutomationElementtopLevelAncestorUiaWindowFlavorElement
UiaFlavorElement(AutomationElement, UiaWindowFlavorElement, string)
protected UiaFlavorElement(AutomationElement uiElement, UiaWindowFlavorElement topLevelAncestor, string flavorName)
Parameters
uiElementAutomationElementtopLevelAncestorUiaWindowFlavorElementflavorNamestring
Properties
AcceleratorKey
public string AcceleratorKey { get; }
Property Value
AccessKey
public string AccessKey { get; }
Property Value
AutomationId
public string AutomationId { get; }
Property Value
ClassName
public string ClassName { get; }
Property Value
ElementRectangle
The client or screen rectangle of the flavor element depending on the value returned by IsClientRectangle.
public override Rectangle ElementRectangle { get; }
Property Value
Remarks
To be implemented by the deriving class.
Enabled
True if the element is enabled. If the element cannot be enabled or disabled, return true.
public override bool Enabled { get; }
Property Value
Remarks
To be implemented by the deriving class.
FrameworkId
public string FrameworkId { get; }
Property Value
HasFocus
True if the element has the focus.
public override bool HasFocus { get; }
Property Value
Remarks
To be implemented by the deriving class.
HelpText
public string HelpText { get; }
Property Value
IsClientRectangle
Determines if the ElementRectangle property returns client or screen coordinates.
public override bool IsClientRectangle { get; }
Property Value
Remarks
To be implemented by the deriving class.
ItemStatus
public string ItemStatus { get; }
Property Value
ItemType
public string ItemType { get; }
Property Value
LocalizedControlType
public string LocalizedControlType { get; }
Property Value
Name
public virtual string Name { get; }
Property Value
NativeWindowHandle
public object NativeWindowHandle { get; }
Property Value
Valid
True if the flavor element is still valid.
public override bool Valid { get; }
Property Value
Remarks
To be implemented by the deriving class.
Visible
True if the element is visible.
public override bool Visible { get; }
Property Value
Remarks
To be implemented by the deriving class.
Methods
CanReplace(FlavorElement)
Returns a value specifying if this flavor element can replace elem.
public override bool CanReplace(FlavorElement flavorElem)
Parameters
flavorElemFlavorElement
Returns
- bool
Trueif this flavor element can replaceelem, otherwisefalse.
Remarks
The base method returns true if this flavor element IsEqual(FlavorElement)
to elem.
EnsureVisible()
Ensures that the flavor element is visible.
public override bool EnsureVisible()
Returns
- bool
True if the operation was successful.
Focus()
Focuses the flavor element, if possible.
public override void Focus()
GetAttributeValue(Element, string)
Needs to be implemented for attribute value read access.
[HandleProcessCorruptedStateExceptions]
public override object GetAttributeValue(Element element, string name)
Parameters
Returns
- object
The attribute value.
GetChildLineageFromPoint(Point, out FindRefineMode)
Returns a list of flavor elements that is the lineage to the flavor element at the specified screen location.
public override LinkedList<FlavorElement> GetChildLineageFromPoint(Point screenLocation, out FindRefineMode refineMode)
Parameters
screenLocationPointThe screen location to search at.
refineModeFindRefineModeCan be set to indicate that further searching is required.
Returns
- LinkedList<FlavorElement>
The lineage to the flavor element at the specified point as a list.
Remarks
The first element in the returned list is the direct child of this flavor element, the k-th element is the parent of the (k+1)-th element, and the last element is the actual flavor element at the specified screen location. Consequently, an empty list is to be returned if this element is the best fitting element at the requested point.
Returns null if the specified screenLocation is not within this
or one of its descendant elements.
GetElementCapabilities(Element, out Role, out string[], out string)
Supplies the role, a list of capabilities and a preferred capability names to the caller. This method called when building a new element from the flavor element.
public override void GetElementCapabilities(Element parent, out Role role, out string[] capabilities, out string preferredCap)
Parameters
parentElementThe parent element of the element to be constructed. (for reference only)
roleRoleThe role the element should have.
capabilitiesstring[]The list of capabilities the element should have.
preferredCapstringThe preferred capability the element should have.
GetPropertyValue(AutomationProperty)
public object GetPropertyValue(AutomationProperty property)
Parameters
propertyAutomationProperty
Returns
GetRuntimeTokenValues()
Gets the runtime token values. This must be implemented by the flavors.
protected override object[] GetRuntimeTokenValues()
Returns
- object[]
A collection of objects representing a runtime token.
HandleException(Exception)
protected Exception HandleException(Exception ex)
Parameters
exException
Returns
InvokeAction(Element, string, object[])
Needs to be implemented for element action invocation.
public override object InvokeAction(Element element, string name, object[] args)
Parameters
elementElementThe element instance used.
namestringThe name of the action (lowercased).
argsobject[]A list of invocation parameters.
Returns
SetAttributeValue(Element, string, object)
Needs to be implemented for attribute value write access.
public override void SetAttributeValue(Element element, string name, object value)