using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace Apewer.WinForm
{
/// Windows 窗体工具。
public static class Extensions
{
static void MenuItemEventHandler(object sender, EventArgs e)
{
#if NETFRAMEWORK
var mi = sender as System.Windows.Forms.MenuItem;
if (mi != null)
{
var tag = mi.Tag as MenuItem;
if (tag != null && tag.Action != null) tag.Action.Invoke(tag);
}
#endif
var tsmi = sender as System.Windows.Forms.ToolStripMenuItem;
if (tsmi != null)
{
var tag = tsmi.Tag as MenuItem;
if (tag != null && tag.Action != null) tag.Action.Invoke(tag);
}
}
#if NETFRAMEWORK
/// 生成 实例。
///
public static ContextMenu ContextMenu(this IEnumerable