mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Merge pull request #234 from DarthAffe/SmallImprovements
Small improvements
This commit is contained in:
commit
fab2c158af
@ -14,13 +14,18 @@ namespace RGB.NET.Core
|
|||||||
private readonly List<T> _decorators = new();
|
private readonly List<T> _decorators = new();
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <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
|
Decorators = new ReadOnlyCollection<T>(_decorators);
|
||||||
{
|
|
||||||
lock (_decorators)
|
|
||||||
return new ReadOnlyCollection<T>(_decorators);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -68,7 +68,7 @@ namespace RGB.NET.Devices.DMX.E131
|
|||||||
this.Hostname = deviceDefinition.Hostname;
|
this.Hostname = deviceDefinition.Hostname;
|
||||||
this.Port = deviceDefinition.Port;
|
this.Port = deviceDefinition.Port;
|
||||||
this.Universe = deviceDefinition.Universe;
|
this.Universe = deviceDefinition.Universe;
|
||||||
|
|
||||||
byte[]? cid = deviceDefinition.CID;
|
byte[]? cid = deviceDefinition.CID;
|
||||||
if ((cid == null) || (cid.Length != CID_LENGTH))
|
if ((cid == null) || (cid.Length != CID_LENGTH))
|
||||||
{
|
{
|
||||||
@ -76,7 +76,7 @@ namespace RGB.NET.Devices.DMX.E131
|
|||||||
new Random().NextBytes(cid);
|
new Random().NextBytes(cid);
|
||||||
}
|
}
|
||||||
|
|
||||||
CID = cid!;
|
CID = cid;
|
||||||
|
|
||||||
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
|
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user