예제 #1
0
        /// <summary>
        /// 清空所有牌組
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuClearDecks_Click(object sender, EventArgs e)
        {
            var confirmResult = YesNoBox.Show($"確定要清空所有牌組資訊嗎?", "刪除");

            if (confirmResult != DialogResult.Yes)
            {
                return;
            }

            DataHelper.DeleteAllDeck();
        }
예제 #2
0
        /// <summary>
        /// 刪除牌組
        /// </summary>
        /// <param name="deck"></param>
        private void DeleteDeck(Deck deck, DataGridViewRow dataGridViewRow)
        {
            dataGridViewRow.DefaultCellStyle.BackColor = Color.PaleVioletRed;

            var confirmResult = YesNoBox.Show($"確定要刪除此牌組({deck.Name})?", "刪除");

            if (confirmResult == DialogResult.Yes)
            {
                DataHelper.DeleteDeck(deck);
            }
            else
            {
                dataGridViewRow.DefaultCellStyle.BackColor = Color.Empty;
            }
        }