diff --git a/RGB.NET.Core/Decorators/AbstractDecorateable.cs b/RGB.NET.Core/Decorators/AbstractDecorateable.cs index 8acfc54..50602ae 100644 --- a/RGB.NET.Core/Decorators/AbstractDecorateable.cs +++ b/RGB.NET.Core/Decorators/AbstractDecorateable.cs @@ -14,13 +14,18 @@ namespace RGB.NET.Core private readonly List _decorators = new(); /// - public IReadOnlyCollection Decorators + public IReadOnlyCollection Decorators { get; } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + protected AbstractDecoratable() { - get - { - lock (_decorators) - return new ReadOnlyCollection(_decorators); - } + Decorators = new ReadOnlyCollection(_decorators); } #endregion diff --git a/RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs b/RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs index a7606af..d7f46be 100644 --- a/RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs +++ b/RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs @@ -68,7 +68,7 @@ namespace RGB.NET.Devices.DMX.E131 this.Hostname = deviceDefinition.Hostname; this.Port = deviceDefinition.Port; this.Universe = deviceDefinition.Universe; - + byte[]? cid = deviceDefinition.CID; if ((cid == null) || (cid.Length != CID_LENGTH)) { @@ -76,7 +76,7 @@ namespace RGB.NET.Devices.DMX.E131 new Random().NextBytes(cid); } - CID = cid!; + CID = cid; DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model); }