TX Text Control .NET Server

MenuItem Class

Class|Introduced in 21.0
Namespace
TXTextControl.ServerVisualisation
Package
TXTextControl.TextControl.Core.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Server.Core.dll
Install
dotnet add package TXTextControl.TextControl.Core.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.Server.dll from the setup.
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.Server.dll

Description

The MenuItem class provides all data necessary to visualize a menu item, such as the menu's text and the menu's image. An item has an Items property specifying a submenu. If there is no text specified, the menu item is a separator.

Syntax

public class MenuItem

Examples

The following example includes the image value from a Menu Item object in application diagnostics. The created object is then available to the surrounding document workflow.

Console.WriteLine($"Image: {menuItem.Image}");
Console.WriteLine("Menu Item is ready for use.");

Members

Properties

PropertyDescription
CheckedGets a value indicating whether the menu item is checked.
EnabledGets a value indicating whether the menu item is enabled.
ImageGets the menu item's image. If the property's value is null, the menu item has no image.
ImageNameNot described in the reference. public string ImageName { get; }
ItemsGets an array of ServerVisualization.MenuItem objects specifying a submenu. These objects contain all data necessary to display the submenu. If the property's value is null, the item has no submenu.
TextGets the menu item's text. If the property's value is null, the menu item is a separator.

Methods

MethodDescription
ExecuteExecutes the menu item. When the menu item opens a dialog box, the method creates and returns a DialogViewGenerator object. Otherwise it performs changes in the document.