using System;
using System.Text.Json.Serialization;
namespace ElectronNET.API.Entities
{
///
///
///
public class MenuItem
{
///
/// Will be called with click(menuItem, browserWindow, event) when the menu item is
/// clicked.
///
[JsonIgnore]
public Action Click { get; set; }
///
/// Define the action of the menu item, when specified the click property will be
/// ignored.
///
public MenuRole Role { get; set; }
///
/// Can be normal, separator, submenu, checkbox or radio.
///
public MenuType Type { get; set; }
///
/// Gets or sets the label.
///
///
/// The label.
///
public string Label { get; set; }
///
/// Gets or sets the sublabel.
///
///
/// The sublabel.
///
public string Sublabel { get; set; }
///
/// Gets or sets the accelerator.
///
///
/// The accelerator.
///
public string Accelerator { get; set; }
///
/// Gets or sets the icon.
///
///
/// The icon.
///
public string Icon { get; set; }
///
/// If false, the menu item will be greyed out and unclickable.
///
public bool Enabled { get; set; } = true;
///
/// If false, the menu item will be entirely hidden.
///
public bool Visible { get; set; } = true;
///
/// Should only be specified for checkbox or radio type menu items.
///
public bool Checked { get; set; }
///
/// Should be specified for submenu type menu items. If submenu is specified, the
/// type: 'submenu' can be omitted.If the value is not a Menu then it will be
/// automatically converted to one using Menu.buildFromTemplate.
///
public MenuItem[] Submenu { get; set; }
///
/// Unique within a single menu. If defined then it can be used as a reference to
/// this item by the position attribute.
///
public string Id { get; internal set; }
///
/// This field allows fine-grained definition of the specific location within a
/// given menu.
///
public string Position { get; set; }
}
}