1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 01:58:30 +00:00

Merge pull request #234 from DarthAffe/SmallImprovements

Small improvements
This commit is contained in:
DarthAffe 2021-09-06 00:59:03 +02:00 committed by GitHub
commit fab2c158af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View File

@ -14,13 +14,18 @@ namespace RGB.NET.Core
private readonly List<T> _decorators = new();
/// <inheritdoc />
public IReadOnlyCollection<T> Decorators
public IReadOnlyCollection<T> Decorators { get; }
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="AbstractDecoratable{T}"/> class.
/// </summary>
protected AbstractDecoratable()
{
get
{
lock (_decorators)
return new ReadOnlyCollection<T>(_decorators);
}
Decorators = new ReadOnlyCollection<T>(_decorators);
}
#endregion

View File

@ -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);
}