-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathPopupMenuElement.cs
More file actions
27 lines (24 loc) · 883 Bytes
/
PopupMenuElement.cs
File metadata and controls
27 lines (24 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ***********************************************************************
// Copyright (c) Charlie Poole and TestCentric contributors.
// Licensed under the MIT License. See LICENSE file in root directory.
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace TestCentric.Gui.Elements
{
/// <summary>
/// PopupMenuElement represents a menu item with subitems,
/// which may need to be populated when they are about to
/// to be displayed.
/// </summary>
public class PopupMenuElement : ToolStripMenuElement, IPopup
{
public event CommandHandler Popup;
public PopupMenuElement(ToolStripMenuItem menuItem)
: base(menuItem)
{
menuItem.DropDownOpening += (s, e) => Popup?.Invoke();
}
}
}