// Mystery Gift IO (.file<->window) private void B_Import_Click(object sender, EventArgs e) { OpenFileDialog import = new OpenFileDialog {Filter = WinFormsUtil.getMysterGiftFilter(SAV.Generation)}; if (import.ShowDialog() != DialogResult.OK) return; string path = import.FileName; MysteryGift g = MysteryGift.getMysteryGift(File.ReadAllBytes(path), Path.GetExtension(path)); if (g == null) { WinFormsUtil.Error("File is not a Mystery Gift:", path); return; } viewGiftData(g); }