using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;

namespace NotepadEnhanced.Refactexing
{
    public partial class AddRefactexForm : Form
    {
        [Browsable(false)]
        public Stack<Refactex> ToBeAdded { get; private set; }

        public AddRefactexForm()
        {
            InitializeComponent();
            ToBeAdded = new Stack<Refactex>();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            ToBeAdded.Push(refactexPanel.Refactex);
            refactexPanel.ClearInput();
        }

        private void refactexPanel_SubmittableChanged(object sender, EventArgs e)
        {
            btnAdd.Enabled = refactexPanel.Submittable;
        }
    }
}
