Class ContextMenu
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents a context popup menu.
public class ContextMenu : Adapter, IAdapter
- Inheritance
-
ContextMenu
- Implements
- Inherited Members
Constructors
ContextMenu()
Creates a new ContextMenu adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected ContextMenu()
ContextMenu(Element)
Creates a new ContextMenu adapter instance.
public ContextMenu(Element element)
Parameters
elementElementThe element to create the adapter for.
Exceptions
- NullReferenceException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Properties
Current
Gets the currently active context menu.
public static ContextMenu Current { get; }
Property Value
- ContextMenu
The currently active context menu.
Exceptions
- ElementNotFoundException
If the element is not found.
this[string]
Gets the MenuItem with the specified label.
public MenuItem this[string itemLabel] { get; }
Parameters
itemLabelstring
Property Value
- MenuItem
The menu item.
Exceptions
- ElementNotFoundException
If no item with that label is found.
Items
Gets the menu items contained in the context menu or popup menu.
public IList<MenuItem> Items { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static ContextMenu FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- ContextMenu
The ContextMenu.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
FromPath(string)
Converts a string to an instance of this class by searching the root.
public static ContextMenu FromPath(string path)
Parameters
pathstringThe search path.
Returns
- ContextMenu
The ContextMenu.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Operators
implicit operator ContextMenu(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator ContextMenu(Element element)
Parameters
elementElementThe element to convert.
Returns
- ContextMenu
The ContextMenu.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator ContextMenu(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator ContextMenu(string path)
Parameters
pathstringThe search path.
Returns
- ContextMenu
The ContextMenu.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.