public BeatmapDeleteDialog(WorkingBeatmap beatmap) { if (beatmap == null) { throw new ArgumentNullException(nameof(beatmap)); } Icon = FontAwesome.fa_trash_o; HeaderText = @"Confirm deletion of"; BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}"; Buttons = new PopupDialogButton[] { new PopupDialogOkButton { Text = @"Yes. Totally. Delete it.", Action = () => { beatmap.Dispose(); database.Delete(beatmap.BeatmapSetInfo); }, }, new PopupDialogCancelButton { Text = @"Firetruck, I didn't mean to!", }, }; }
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { switch (args.Key) { case Key.Enter: footer.StartButton.TriggerClick(); return(true); case Key.Delete: if (Beatmap != null) { Beatmap.Dispose(); database.Delete(Beatmap.BeatmapSetInfo); } return(true); } return(base.OnKeyDown(state, args)); }