Пример #1
0
 /// <summary>
 /// Gets an error message from a result code.
 /// </summary>
 /// <param name="result">Result code</param>
 /// <returns>Error message</returns>
 public static string GetMessage(this DiskCacheLoadResult result)
 {
     return(result switch
     {
         DiskCacheLoadResult.Success => "No error.",
         DiskCacheLoadResult.NoAccess => "Could not access the cache file.",
         DiskCacheLoadResult.InvalidCb1DataLength => "Constant buffer 1 data length is too low.",
         DiskCacheLoadResult.MissingTextureDescriptor => "Texture descriptor missing from the cache file.",
         DiskCacheLoadResult.FileCorruptedGeneric => "The cache file is corrupted.",
         DiskCacheLoadResult.FileCorruptedInvalidMagic => "Magic check failed, the cache file is corrupted.",
         DiskCacheLoadResult.FileCorruptedInvalidLength => "Length check failed, the cache file is corrupted.",
         DiskCacheLoadResult.IncompatibleVersion => "The version of the disk cache is not compatible with this version of the emulator.",
         _ => "Unknown error."
     });
Пример #2
0
 /// <summary>
 /// Creates a new instance of the disk cache load exception.
 /// </summary>
 /// <param name="result">Result code</param>
 public DiskCacheLoadException(DiskCacheLoadResult result) : base(result.GetMessage())
 {
     Result = result;
 }