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 WindowsFormsApp_ZaawProgLab03
{
    public partial class FrmDialog : Form
    {
        public FrmDialog()
        {
            InitializeComponent();
        }

        public delegate void AddItemDelegate(string item);
        public AddItemDelegate AddItemCallback;
        private void button1_Click(object sender, EventArgs e)
        {
            //Notification subscribers
            AddItemCallback(txtItem.Text);
        }

        private void FrmDialog_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            e.Cancel = true;
        }
    }
}
