mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 13:45:34 +08:00
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:
parent
7fb26371e3
commit
a9ffd7cccc
@ -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"));
|
||||
}
|
||||
}
|
||||
|
@ -178,5 +178,18 @@ namespace GameRes
|
||||
{
|
||||
get { return this.GetType().Assembly == typeof(ImageFormat).Assembly; }
|
||||
}
|
||||
|
||||
public static ImageFormat FindByTag (string tag)
|
||||
{
|
||||
return FormatCatalog.Instance.ImageFormats.FirstOrDefault (x => x.Tag == tag);
|
||||
}
|
||||
|
||||
static readonly Lazy<ImageFormat> s_JpegFormat = new Lazy<ImageFormat> (() => FindByTag ("JPEG"));
|
||||
static readonly Lazy<ImageFormat> s_PngFormat = new Lazy<ImageFormat> (() => FindByTag ("PNG"));
|
||||
static readonly Lazy<ImageFormat> s_BmpFormat = new Lazy<ImageFormat> (() => FindByTag ("BMP"));
|
||||
|
||||
public static ImageFormat Jpeg { get { return s_JpegFormat.Value; } }
|
||||
public static ImageFormat Png { get { return s_PngFormat.Value; } }
|
||||
public static ImageFormat Bmp { get { return s_BmpFormat.Value; } }
|
||||
}
|
||||
}
|
||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion ("1.1.4.8")]
|
||||
[assembly: AssemblyFileVersion ("1.1.4.8")]
|
||||
[assembly: AssemblyVersion ("1.1.5.8")]
|
||||
[assembly: AssemblyFileVersion ("1.1.5.8")]
|
||||
|
Loading…
Reference in New Issue
Block a user