예제 #1
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            if (txt_Store.Text == string.Empty)
            {
                MessageBox.Show("空");
                return;
            }

            if (_favoriteList.GetStoreList().Any(x => x == txt_Store.Text))
            {
                MessageBox.Show("同名存在");
                return;
            }

            var item = new FavoriteItem(txt_Store.Text, cmb_Prefecture.SelectedText);

            _favoriteList.AddWrite(item);

            DialogResult = DialogResult.OK;
            Close();
        }
예제 #2
0
 private void SetComboBox()
 {
     cmb_DeleteItem.DataSource    = new BindingSource(_favoriteList.GetStoreList(), null);
     cmb_DeleteItem.Enabled       = true;
     cmb_DeleteItem.SelectedIndex = 0;
 }