public async Task OpenFile(string filename, IFileSystem provider) { var toOpen = new BitBlockFile(); await toOpen.OpenFile(filename, provider); // matix2267's convention adds 6 bits to the beginning of a file so that the name will be byte-aligned for (int i = 1; i <= 8 - (BitLength % 8); i++) { toOpen.Bits.Bits.RemoveAt(0); } Initialize(toOpen.Bits); }
public async Task Save(string filename, IFileSystem provider) { var toSave = new BitBlockFile(); // matix2267's convention adds 6 bits to the beginning of a file so that the name will be byte-aligned for (int i = 1; i <= 8 - (BitLength % 8); i++) { toSave.Bits.Bits.Add(false); } toSave.Bits.Bits.AddRange(GetQuicksavePokemonBits()); await toSave.Save(filename, provider); FileSaved?.Invoke(this, new EventArgs()); }