PKHeX.SAV_SecretBase.B_FDelete_Click C# (CSharp) Method

B_FDelete_Click() private method

private B_FDelete_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void B_FDelete_Click(object sender, EventArgs e)
        {
            if (LB_Favorite.SelectedIndex < 1) { Util.Alert("Cannot delete your Secret Base."); return; }
            int index = LB_Favorite.SelectedIndex - 1;

            const int favoff = fav_offset + 0x5400 + 0x63A;
            string BaseTrainer = Util.TrimFromZero(Encoding.Unicode.GetString(sav, sv + favoff + index * 0x3E0 + 0x218, 0x1A));
            if (BaseTrainer.Length < 1 || BaseTrainer[0] == '\0')
                BaseTrainer = "Empty";

            if (
                Util.Prompt(MessageBoxButtons.YesNo,
                    String.Format("Delete {1}'s base (Entry {0}) from your records?", index, BaseTrainer)) != DialogResult.Yes) 
                return;
            const int max = 29; 
            const int size = 0x3E0;
            int offset = sv + favoff + index * size;
            if (index != max) Array.Copy(sav, offset + size, sav, offset, size * (max - index));
            // Ensure Last Entry is Cleared
            Array.Copy(new byte[size], 0, sav, size * max, size);
            popFavorite();
        }
    }