ATMLCommonLibrary.controls.switching.SwitchControl.lvInterface_OnDelete C# (CSharp) Method

lvInterface_OnDelete() private method

private lvInterface_OnDelete ( ) : void
return void
        private void lvInterface_OnDelete()
        {
            if (lvInterface.HasSelected)
            {
                var port = lvInterface.SelectedItems[0].Tag as Port;
                if (port != null)
                {
                    if (DialogResult.Yes == MessageBox.Show(String.Format("Delete Interface Port \"{0}\"", port.name),
                                                            @"D E L E T E",
                                                            MessageBoxButtons.YesNo,
                                                            MessageBoxIcon.Question))
                    {
                        lvInterface.SelectedItems[0].Remove();
                    }
                }
            }
        }