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 NewButton; public event EventHandler DeleteButton; public CollectiveListAddDelete() { InitializeComponent(); } protected virtual void OnNewButton(EventArgs e) { EventHandler handler = NewButton; if (handler != null) { handler(this, e); } } protected virtual void OnDeleteButton(EventArgs e) { EventHandler 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); } } }