DarkLoader.PatchEditor.btnDeletePatch_Click C# (CSharp) Method

btnDeletePatch_Click() private method

private btnDeletePatch_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void btnDeletePatch_Click(object sender, EventArgs e)
        {
            GoogleAnalyticsApi.TrackEvent("PatchEditor.cs", "btnDeletePatch_Click", "");
            DialogResult dialogResult = MessageBox.Show("Are you sure you want to remove the patch named \"" + listPatches.SelectedItems[0].ToString() + "\"", "Delete Patch?", MessageBoxButtons.YesNo);
            if (dialogResult == DialogResult.Yes)
            {
                int index = listPatches.SelectedIndex;
                patches.PatchList.RemoveAt(index);
                listPatches.SelectedIndex = index - 1;
                WritePatchesToDisk();
            }
        }