Worms4Editor/W4Gui/Components/CollectiveListAddDelete.cs

52 lines
1.3 KiB
C#

using LibW4M.Data;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace W4Gui.Components
{
public partial class CollectiveListAddDelete : UserControl
{
public event EventHandler<EventArgs> NewButton;
public event EventHandler<EventArgs> DeleteButton;
public CollectiveListAddDelete()
{
InitializeComponent();
}
protected virtual void OnNewButton(EventArgs e)
{
EventHandler<EventArgs> handler = NewButton;
if (handler != null)
{
handler(this, e);
}
}
protected virtual void OnDeleteButton(EventArgs e)
{
EventHandler<EventArgs> handler = DeleteButton;
if (handler != null)
{
handler(this, e);
}
}
private void btnAdd_Click(object sender, EventArgs e)
{
OnNewButton(e);
}
private void btnDel_Click(object sender, EventArgs e)
{
// if (lstCollective.SelectedIndex >= 0)
OnDeleteButton(e);
}
}
}