diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-08-13 18:24:59 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-08-13 18:24:59 +0300 |
commit | 729daca5c5a2f4148b91794108522ac306029439 (patch) | |
tree | 8eeefb1838111dcc2d42f3ab20fcafe26dbf508d /UVtools.Core | |
parent | 4beb2af96196e96cccadf7f2d901878dec7c5855 (diff) |
Update FileExtension.cs
Diffstat (limited to 'UVtools.Core')
-rw-r--r-- | UVtools.Core/FileFormats/FileExtension.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/UVtools.Core/FileFormats/FileExtension.cs b/UVtools.Core/FileFormats/FileExtension.cs index fdd2ce8..be4baea 100644 --- a/UVtools.Core/FileFormats/FileExtension.cs +++ b/UVtools.Core/FileFormats/FileExtension.cs @@ -18,7 +18,7 @@ namespace UVtools.Core.FileFormats { #region Properties /// <summary> - /// Stores a specific Type that should be used to create this FileExtension instance + /// Stores a specific <see cref="FileFormat"/> type that should be used to create with this FileExtension instance /// </summary> public Type FileFormatType { get; } @@ -114,9 +114,11 @@ namespace UVtools.Core.FileFormats #region Methods - public FileFormat GetFileFormat() => - FileFormat.FindByExtension(Extension); - + public FileFormat GetFileFormat(bool createNewInstance = false) => + FileFormatType is null + ? FileFormat.FindByExtension(Extension, false, createNewInstance) + : FileFormat.FindByType(FileFormatType, createNewInstance); + public static FileExtension Find(string extension)=> FileFormat.FindExtension(extension); #endregion |