Inheritance
System.Object
MenuBarItem
Assembly: Terminal.Gui.dll
public class MenuBarItem : MenuItem
Constructors
Declaration
Declaration
public MenuBarItem(ustring title, ustring help, Action action, Func<bool> canExecute = null, MenuItem parent = null)
Parameters
Type |
Name |
Description |
NStack.ustring |
title |
Title for the menu item. |
NStack.ustring |
help |
Help text to display. |
System.Action |
action |
Action to invoke when the menu item is activated. |
System.Func<System.Boolean> |
canExecute |
Function to determine if the action can currently be executed. |
MenuItem |
parent |
The parent MenuItem of this if exist, otherwise is null. |
Initializes a new
MenuBarItem with separate list of items.
Declaration
public MenuBarItem(ustring title, List<MenuItem[]> children, MenuItem parent = null)
Parameters
Type |
Name |
Description |
NStack.ustring |
title |
Title for the menu item. |
System.Collections.Generic.List<MenuItem[]> |
children |
The list of items in the current menu. |
MenuItem |
parent |
The parent MenuItem of this if exist, otherwise is null. |
Declaration
public MenuBarItem(ustring title, MenuItem[] children, MenuItem parent = null)
Parameters
Type |
Name |
Description |
NStack.ustring |
title |
Title for the menu item. |
MenuItem[] |
children |
The items in the current menu. |
MenuItem |
parent |
The parent MenuItem of this if exist, otherwise is null. |
Declaration
public MenuBarItem(MenuItem[] children)
Parameters
Type |
Name |
Description |
MenuItem[] |
children |
The items in the current menu. |
Properties
Declaration
public MenuItem[] Children { get; set; }
Property Value
Type |
Description |
MenuItem[] |
The children. |
Methods
Get the index of the
MenuItem parameter.
Declaration
public int GetChildrenIndex(MenuItem children)
Parameters
Returns
Type |
Description |
System.Int32 |
Returns a value bigger than -1 if the MenuItem is a child of this. |
Check if the
MenuItem parameter is a child of this.
Declaration
public bool IsSubMenuOf(MenuItem menuItem)
Parameters
Returns
Type |
Description |
System.Boolean |
Returns true if it is a child of this. false otherwise. |
Declaration
public MenuBarItem SubMenu(MenuItem children)
Parameters
Returns