using System;
using System.Windows.Forms;

namespace PostCardHitsuji.Ui.RowPanel
{
    public partial class SearchPanelMapping : UserControl
    {
        public event EventHandler SearchTextChangedEvent;
        public event EventHandler ButtonRefreshClickedEvent;

        
        public SearchPanelMapping()
        {
            InitializeComponent();

            textBoxText2.TextChanged += new EventHandler(onSearchTextChanged);
            textBoxText3.TextChanged += new EventHandler(onSearchTextChanged);
            textBoxText4.TextChanged += new EventHandler(onSearchTextChanged);

            buttonRefresh.Click += new EventHandler(onButtonRefreshClicked);

        }

        private void onSearchTextChanged(object sender, EventArgs ev)
        {
            if (SearchTextChangedEvent != null)
                SearchTextChangedEvent(sender, ev);
        }

        private void onButtonRefreshClicked(object sender, EventArgs ev)
        {
            if (ButtonRefreshClickedEvent != null)
                ButtonRefreshClickedEvent(sender, ev);
        }

        public string Text2　{　get { return textBoxText2.Text; }　}
        public string Text3　{　get { return textBoxText3.Text; }　}
        public string Text4　{　get { return textBoxText4.Text; }　}

        public string Label2
        {
            get { return labelTitle2.Text; }
            set
            {
                labelTitle2.Text = value;
                labelTitle2.Visible = textBoxText2.Visible = value.Equals("") ? false : true;
            }
        }
        public string Label3
        {
            get { return labelTitle3.Text; }
            set
            {
                labelTitle3.Text = value;
                labelTitle3.Visible = textBoxText3.Visible = value.Equals("") ? false : true;
            }
        }
        public string Label4
        {
            get { return labelTitle4.Text; }
            set
            {
                labelTitle4.Text = value;
                labelTitle4.Visible = textBoxText4.Visible = value.Equals("") ? false : true;
            }
        }

    }
}
