From 578a033a19583099d104f166e8737bf44b4a92b7 Mon Sep 17 00:00:00 2001 From: Lehonti Ramos Date: Sat, 5 Aug 2023 22:41:46 +0200 Subject: [PATCH] `PaletteDescriptor.Extensions` was turned into `ReadOnlyCollection` --- Pinta.Core/PaletteFormats/PaletteDescriptor.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Pinta.Core/PaletteFormats/PaletteDescriptor.cs b/Pinta.Core/PaletteFormats/PaletteDescriptor.cs index a100b9629..4e145789f 100644 --- a/Pinta.Core/PaletteFormats/PaletteDescriptor.cs +++ b/Pinta.Core/PaletteFormats/PaletteDescriptor.cs @@ -24,6 +24,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Text; using Gtk; @@ -31,7 +33,7 @@ namespace Pinta.Core { public sealed class PaletteDescriptor { - public string[] Extensions { get; } + public ReadOnlyCollection Extensions { get; } public IPaletteLoader Loader { get; } @@ -39,16 +41,16 @@ public sealed class PaletteDescriptor public FileFilter Filter { get; } - public PaletteDescriptor (string displayPrefix, string[] extensions, IPaletteLoader loader, IPaletteSaver saver) + public PaletteDescriptor (string displayPrefix, IEnumerable extensions, IPaletteLoader loader, IPaletteSaver saver) { - this.Extensions = extensions; + this.Extensions = extensions.ToReadOnlyCollection (); this.Loader = loader; this.Saver = saver; var ff = FileFilter.New (); StringBuilder formatNames = new StringBuilder (); - foreach (string ext in extensions) { + foreach (string ext in Extensions) { if (formatNames.Length > 0) formatNames.Append (", ");