added shortcuts to standard formats as static properties of ImageFormat and AudioFormat.

namely,
ImageFormat.Jpeg
ImageFormat.Png
ImageFormat.Bmp
AudioFormat.Wav
This commit is contained in:
morkt
2015-08-14 06:05:15 +04:00
parent 7fb26371e3
commit a9ffd7cccc
3 changed files with 21 additions and 2 deletions

View File

@@ -23,7 +23,9 @@
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Linq;
namespace GameRes
{
@@ -167,5 +169,9 @@ namespace GameRes
}
return null;
}
public static AudioFormat Wav { get { return s_WavFormat.Value; } }
static readonly Lazy<AudioFormat> s_WavFormat = new Lazy<AudioFormat> (() => FormatCatalog.Instance.AudioFormats.FirstOrDefault (x => x.Tag == "WAV"));
}
}