You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
|
|
namespace Apewer.WinForm
|
|
{
|
|
|
|
/// <summary>菜单项。</summary>
|
|
public class MenuItem
|
|
{
|
|
|
|
/// <summary>显示的文本,不设置此属性时菜单将显示未为分隔线。</summary>
|
|
public string Text { get; set; }
|
|
|
|
/// <summary>点击菜单时要执行的命令。</summary>
|
|
public Action<MenuItem> Action { get; set; }
|
|
|
|
// /// <summary>菜单中显示的图片。</summary>
|
|
// public Image Image { get; set; }
|
|
|
|
/// <summary>自定义数据。</summary>
|
|
public virtual object Data { get; set; }
|
|
|
|
/// <summary>创建菜单项。</summary>
|
|
public MenuItem() { }
|
|
|
|
/// <summary>创建文本菜单项。</summary>
|
|
public MenuItem(string text)
|
|
{
|
|
Text = text;
|
|
}
|
|
|
|
/// <summary>创建可点击的文本菜单项。</summary>
|
|
public MenuItem(string text, Action<MenuItem> action)
|
|
{
|
|
Text = text;
|
|
Action = action;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|