1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Changed device lists in the DevicesChanged-event to readonly

This commit is contained in:
Darth Affe 2023-05-08 21:30:52 +02:00
parent 7e72d3199b
commit 67f3625993

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace RGB.NET.Core; namespace RGB.NET.Core;
@ -7,8 +8,8 @@ public sealed class DevicesChangedEventArgs : EventArgs
{ {
#region Properties & Fields #region Properties & Fields
public IList<IRGBDevice> Added { get; } public IReadOnlyList<IRGBDevice> Added { get; }
public IList<IRGBDevice> Removed { get; } public IReadOnlyList<IRGBDevice> Removed { get; }
#endregion #endregion
@ -16,8 +17,8 @@ public sealed class DevicesChangedEventArgs : EventArgs
private DevicesChangedEventArgs(IList<IRGBDevice> added, IList<IRGBDevice> removed) private DevicesChangedEventArgs(IList<IRGBDevice> added, IList<IRGBDevice> removed)
{ {
this.Added = added; this.Added = new ReadOnlyCollection<IRGBDevice>(added);
this.Removed = removed; this.Removed = new ReadOnlyCollection<IRGBDevice>(removed);
} }
#endregion #endregion