Class MenuBar
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents a menu bar.
public class MenuBar : Adapter, IAdapter
- Inheritance
-
MenuBar
- Implements
- Inherited Members
Constructors
MenuBar()
Creates a new MenuBar adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected MenuBar()
MenuBar(Element)
Creates a new MenuBar adapter instance.
public MenuBar(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
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 menu bar.
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 MenuBar FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- MenuBar
The MenuBar.
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 MenuBar FromPath(string path)
Parameters
pathstringThe search path.
Returns
- MenuBar
The MenuBar.
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 MenuBar(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator MenuBar(Element element)
Parameters
elementElementThe element to convert.
Returns
- MenuBar
The MenuBar.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator MenuBar(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator MenuBar(string path)
Parameters
pathstringThe search path.
Returns
- MenuBar
The MenuBar.
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.