Skip to content

Commit

Permalink
Merge pull request #282 from Lehonti/publicarraystocollectionpart1
Browse files Browse the repository at this point in the history
`PaletteDescriptor.Extensions` was turned into `ReadOnlyCollection<T>`
  • Loading branch information
cameronwhite authored Aug 7, 2023
2 parents b30b076 + 578a033 commit 4a6db0f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Pinta.Core/PaletteFormats/PaletteDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,33 @@
// 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;

namespace Pinta.Core
{
public sealed class PaletteDescriptor
{
public string[] Extensions { get; }
public ReadOnlyCollection<string> Extensions { get; }

public IPaletteLoader Loader { get; }

public IPaletteSaver Saver { get; }

public FileFilter Filter { get; }

public PaletteDescriptor (string displayPrefix, string[] extensions, IPaletteLoader loader, IPaletteSaver saver)
public PaletteDescriptor (string displayPrefix, IEnumerable<string> 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 (", ");

Expand Down

0 comments on commit 4a6db0f

Please sign in to comment.