public static ISaveLocation ToSaveLocation(this SaveLocationManifest manifest)
 {
     return(new SaveLocation(manifest.RecordGuid,
                             manifest.SaveFormat,
                             new DirectoryInfo(manifest.Directory),
                             manifest.LocationGuid,
                             manifest.LastModified));
 }
Esempio n. 2
0
        public async Task <ISaveLocation> GetSaveLocationAsync(Guid saveLocationGuid)
        {
            string manifestPath = Path.Combine(this.SaveLocationRoot.FullName, saveLocationGuid.ToString(),
                                               ManifestFileName);

            if (!File.Exists(manifestPath))
            {
                throw new FileNotFoundException();
            }

            SaveLocationManifest manifest =
                JsonConvert.DeserializeObject <SaveLocationManifest>(await File.ReadAllTextAsync(manifestPath));

            return(manifest.ToSaveLocation());
        }