Example #1
0
        private void DeleteContact()
        {
            var item = GetSelectedContact();

            if (item == null)
            {
                return;
            }

            _database.Delete(item.Name);
            RefreshContacts();
        }
Example #2
0
        private void DeleteContact()
        {
            var item = GetSelectedContact();

            if (item == null)
            {
                return;
            }

            if (MessageBox.Show(this, $"Are you sure you want to Delete this Contact?\n \t({item.Name})", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return;
            }

            _database.Delete(item.Name);
            RefreshContacts();
        }