// Mystery Gift IO (.file<->window) private void B_Import_Click(object sender, EventArgs e) { using var import = new OpenFileDialog { Filter = WinFormsUtil.GetMysterGiftFilter(SAV.Generation, SAV.Version) }; if (import.ShowDialog() != DialogResult.OK) { return; } string path = import.FileName; var g = MysteryGift.GetMysteryGift(File.ReadAllBytes(path), Path.GetExtension(path)); if (g == null) { WinFormsUtil.Error(MsgMysteryGiftInvalid, path); return; } ViewGiftData(g); }