Class MenuWithHandler
A simple structure describing a menu or an menu item (without the use of Windows.Forms).
If ID is null, this is a main menu, if SubMenus is null, it is a simple menu item.
If SubMenus is not null, this structure contains a list of sub-menus.
This structure must be converted to a platform dependent menu and displayed accordingly.
The selection of the menu item is handled by Target, but it can also be handled directly by setting OnCommand
( and OnUpdateCommand and OnSelected).
Inheritance
System.Object
MenuWithHandler
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: CADability.dll
Syntax
public class MenuWithHandler : ICommandHandler
Constructors
|
Improve this Doc
View Source
MenuWithHandler()
Declaration
|
Improve this Doc
View Source
MenuWithHandler(String, String)
creates a new menu item with the provided menuId. If resourceId is null, the menuId is used as the resourceId.
The resourceId specifies the menu text from the string table.
Declaration
public MenuWithHandler(string menuId, string resourceId = null)
Parameters
| Type |
Name |
Description |
| System.String |
menuId |
menu id which is passed on to the OnCommand(String) call
|
| System.String |
resourceId |
the id of the menu text from the string table
|
Properties
|
Improve this Doc
View Source
ID
Declaration
public string ID { get; set; }
Property Value
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
ImageIndex
Declaration
public int ImageIndex { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
MdiList
Declaration
public bool MdiList { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
NotSticky
Declaration
public bool NotSticky { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
OnCommand
Declaration
public Func<string, bool> OnCommand { set; }
Property Value
| Type |
Description |
| System.Func<System.String, System.Boolean> |
|
|
Improve this Doc
View Source
OnSelected
Declaration
public Action<MenuWithHandler, bool> OnSelected { set; }
Property Value
|
Improve this Doc
View Source
OnUpdateCommand
Declaration
public Func<string, CommandState, bool> OnUpdateCommand { set; }
Property Value
| Type |
Description |
| System.Func<System.String, CommandState, System.Boolean> |
|
|
Improve this Doc
View Source
Position
Declaration
public int Position { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
Separator
Declaration
public static MenuWithHandler Separator { get; }
Property Value
|
Improve this Doc
View Source
Shortcut
Declaration
public string Shortcut { get; }
Property Value
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
ShowShortcut
Declaration
public bool ShowShortcut { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
SubMenus
Declaration
public MenuWithHandler[] SubMenus { get; set; }
Property Value
|
Improve this Doc
View Source
Target
Declaration
public ICommandHandler Target { get; set; }
Property Value
|
Improve this Doc
View Source
Text
Declaration
public string Text { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Explicit Interface Implementations
|
Improve this Doc
View Source
ICommandHandler.OnCommand(String)
Declaration
bool ICommandHandler.OnCommand(string MenuId)
Parameters
| Type |
Name |
Description |
| System.String |
MenuId |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
ICommandHandler.OnSelected(MenuWithHandler, Boolean)
Declaration
void ICommandHandler.OnSelected(MenuWithHandler selectedMenu, bool selected)
Parameters
|
Improve this Doc
View Source
ICommandHandler.OnUpdateCommand(String, CommandState)
Declaration
bool ICommandHandler.OnUpdateCommand(string MenuId, CommandState CommandState)
Parameters
| Type |
Name |
Description |
| System.String |
MenuId |
|
| CommandState |
CommandState |
|
Returns
| Type |
Description |
| System.Boolean |
|
Implements