SalMenuItem
Namespace: PPJ.Runtime.Windows
Assembly: PPJ.Web.50 (5.0.0.0)
A SAL command item with action, enabled-state, and checked-state callbacks.
- C#
- VB.NET
public class SalMenuItem : MenuItem, ISalMenu
Public Class SalMenuItem
Inherits MenuItem
Implements ISalMenu
Example:
var command = new SalMenuItem { Text = "Refresh" };
command.EnabledWhen += () => true;
command.MenuActions += () => { RefreshData(); return 0; };
Constructors
SalMenuItem()
Creates an empty SAL command item.
Properties
ImageName
String: Gets or sets the icon resource name, with browser-source fallback. (Default: "")
A changed nonempty name loads from the design site or calling assembly. If no resource image resolves, the name becomes IconSource. Null becomes empty; empty clears Icon.
ImageNormal
Deprecated:
Image: Gets or sets the obsolete normal-image compatibility value. (Default: null)
Stored independently; this property does not assign the rendered Icon.
ImageSelected
Deprecated:
Image: Gets or sets the obsolete selected-image compatibility value. (Default: null)
Stored independently; this property does not assign the rendered Icon.
MenuID
Int32: Gets the inherited numeric menu identifier.
Owner
Control: Gets the control identified as this menu's SAL owner.
StatusText
String: Gets or sets the status-bar hint shown when the menu is selected. (Default: "")
Null becomes empty. The first assignment attaches the selection handler.
Methods
CloneMenu()
Creates the inherited clone and copies SAL callback subscriptions.
Returns: MenuItem. The cloned SalMenuItem.
Dispose(disposing)
Clears SAL callback references before disposing the inherited menu item.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | Whether managed resources are being disposed. |
MergeMenu()
Creates the inherited merged item and copies SAL callback subscriptions.
Returns: MenuItem. The merged SalMenuItem.
OnClick(e)
Invokes SAL command callbacks and then raises the inherited click event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The click event data. |
When a menu context exists, enters that context and refreshes enabled state before running the action. Without a context, invokes the action directly.
OnWebEvent(e)
Processes browser execution events within the menu's SAL context.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | The browser event; execute is routed to the specialized execution handler. |
OnWebRender(config)
Replaces the standard menu-item client class with the SAL client class.
| Parameter | Type | Description |
|---|---|---|
| config | Object | The mutable browser configuration. |
Events
CheckedWhen
SalMenuCheckedWhenHandler Evaluates whether the item should be checked when its SAL state is refreshed.
EnabledWhen
SalMenuEnabledWhenHandler Evaluates whether the menu should be enabled when its SAL state is refreshed.
MenuActions
SalMenuActionsHandler Executes the SAL command when the item is clicked.
Implements
| Name | Description |
|---|---|
| ISalMenu | Exposes menu refresh, status text, and the owning control for SAL menus. |