Table of Contents

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

element Element

The element to create the adapter for.

Exceptions

NullReferenceException

If element is null.

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

itemLabel string

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

IList<MenuItem>

The menu items.

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

element Element

The element to convert.

Returns

MenuBar

The MenuBar.

Exceptions

ArgumentNullException

If element is null.

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

path string

The search path.

Returns

MenuBar

The MenuBar.

Remarks

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is 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

element Element

The element to convert.

Returns

MenuBar

The MenuBar.

Exceptions

ArgumentNullException

If element is null.

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

path string

The search path.

Returns

MenuBar

The MenuBar.

Remarks

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is not valid.

ElementNotFoundException

If no element is found.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.