Example #1
0
        public void TestWriteBackTheSameExactFile() =>
        File.OpenRead(FilePath).Using(stream => Helpers.AssertStream(stream, inStream =>
        {
            var outStream = new MemoryStream();
            SaveKh1.Read(inStream).Write(outStream);

            return(outStream);
        }));
Example #2
0
        public void OpenStream(Stream stream)
        {
            try
            {
                Save = SaveKh1.Read(stream);
            }
            catch (NotSupportedException ex)
            {
                throw new SaveNotSupportedException(ex.Message);
            }

            RefreshUi();
        }
Example #3
0
        public void OpenStream(Stream stream)
        {
            switch (SaveKh1.GetGameVersion(stream))
            {
            case Constants.MagicCodeFm:
                save = SaveKh1.Read <SaveKh1.SaveFinalMix>(stream);
                break;

            default:
                throw new SaveNotSupportedException("The version is not supported.");
            }
            RefreshUi();
        }