ATMLCommonLibrary.controls.IndentificationNumbersListControl.IndentificationNumbersListControl_OnDelete C# (CSharp) Method

IndentificationNumbersListControl_OnDelete() private method

private IndentificationNumbersListControl_OnDelete ( ) : void
return void
        private void IndentificationNumbersListControl_OnDelete()
        {
            if (SelectedItems.Count > 0)
            {
                if (DialogResult.Yes == MessageBox.Show(@"Are you sure you want to delete this Identification Number?",
                    @"Delete Identification Number",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question))
                {
                    var id = (IdentificationNumber) SelectedItems[0].Tag;
                    Items.RemoveAt(SelectedItems[0].Index);
                    _identificationNumbers.Remove(id);
                }
            }
            foreach (ListViewItem lvi in Items)
                lvi.BackColor = lvi.Index % 2 == 0 ? ATMLContext.COLOR_LIST_EVEN : ATMLContext.COLOR_LIST_ODD;
        }