Table of Contents

Class WinFormsCoreFlavorElement

Namespace
Ranorex.Plugin
Assembly
Ranorex.Plugin.WinForms.Core.dll
public class WinFormsCoreFlavorElement : Win32FlavorElement
Inheritance
WinFormsCoreFlavorElement
Inherited Members
Extension Methods

Constructors

WinFormsCoreFlavorElement(IntPtr, IWinFormsAutomation)

protected WinFormsCoreFlavorElement(IntPtr hwnd, IWinFormsAutomation proxy)

Parameters

hwnd IntPtr
proxy IWinFormsAutomation

WinFormsCoreFlavorElement(IntPtr, IWinFormsAutomation, string)

protected WinFormsCoreFlavorElement(IntPtr hwnd, IWinFormsAutomation proxy, string flavorName)

Parameters

hwnd IntPtr
proxy IWinFormsAutomation
flavorName string

Properties

ControlType

public virtual Type ControlType { get; }

Property Value

Type

Enabled

True if the element is enabled. If the element cannot be enabled or disabled, return true.

public override bool Enabled { get; }

Property Value

bool

Remarks

To be implemented by the deriving class.

FullTypeLineage

public string[] FullTypeLineage { get; }

Property Value

string[]

HasFocus

True if the element has the focus.

public override bool HasFocus { get; }

Property Value

bool

Remarks

To be implemented by the deriving class.

Visible

True if the element is visible.

public override bool Visible { get; }

Property Value

bool

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 elem)

Parameters

elem FlavorElement

The element to replace.

Returns

bool

True if this flavor element can replace elem, otherwise false.

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.

public override object GetAttributeValue(Element element, string name)

Parameters

element Element

The element instance used.

name string

The name of the attribute (lowercased).

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

screenLocation Point

The screen location to search at.

refineMode FindRefineMode

Can 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.

GetDynamicDescriptors(out IList<AttributeDescriptor>, out IList<ActionDescriptor>)

Gets the descriptors for the dynamic attributes and actions that the element supports.

public override void GetDynamicDescriptors(out IList<AttributeDescriptor> attributes, out IList<ActionDescriptor> actions)

Parameters

attributes IList<AttributeDescriptor>

The dynamic attributes that the element supports.

actions IList<ActionDescriptor>

The dynamic actions that the element supports.

Remarks

The default implementation returns empty lists for attributes and actions. Any overriding method should fill the returned lists.

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

parent Element

The parent element of the element to be constructed. (for reference only)

role Role

The role the element should have.

capabilities string[]

The list of capabilities the element should have.

preferredCap string

The preferred capability the element should have.

GetPropertyValue(BindingFlags, string)

public object GetPropertyValue(BindingFlags flags, string name)

Parameters

flags BindingFlags
name string

Returns

object

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.

InvokeAction(Element, string, object[])

Needs to be implemented for element action invocation.

public override object InvokeAction(Element element, string name, object[] args)

Parameters

element Element

The element instance used.

name string

The name of the action (lowercased).

args object[]

A list of invocation parameters.

Returns

object

The invocation result. Can be null if the return type is void.

InvokeMethod(BindingFlags, string, object[])

public object InvokeMethod(BindingFlags flags, string name, object[] args)

Parameters

flags BindingFlags
name string
args object[]

Returns

object

InvokeMethod(BindingFlags, string, object[], Duration)

public object InvokeMethod(BindingFlags flags, string name, object[] args, Duration timeout)

Parameters

flags BindingFlags
name string
args object[]
timeout Duration

Returns

object

InvokeRemotely(string, string, string, object)

public object InvokeRemotely(string assemblyPath, string fullTypeName, string methodName, object inputData)

Parameters

assemblyPath string
fullTypeName string
methodName string
inputData object

Returns

object

InvokeRemotely(string, string, string, object, Duration)

public object InvokeRemotely(string assemblyPath, string fullTypeName, string methodName, object inputData, Duration timeout)

Parameters

assemblyPath string
fullTypeName string
methodName string
inputData object
timeout Duration

Returns

object

IsAssignableFrom(Type, Type)

protected static bool IsAssignableFrom(Type t, Type c)

Parameters

t Type
c Type

Returns

bool

SetAttributeValue(Element, string, object)

Needs to be implemented for attribute value write access.

public override void SetAttributeValue(Element element, string name, object value)

Parameters

element Element

The element instance used.

name string

The name of the attribute (lowercased).

value object

The attribute value to be set.

SetPropertyValue(BindingFlags, string, object)

public void SetPropertyValue(BindingFlags flags, string name, object value)

Parameters

flags BindingFlags
name string
value object