Skip to content

Commit

Permalink
Merge pull request #234 from DarthAffe/SmallImprovements
Browse files Browse the repository at this point in the history
Small improvements
  • Loading branch information
DarthAffe committed Sep 5, 2021
2 parents e645e4d + d487bee commit fab2c15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 11 additions & 6 deletions RGB.NET.Core/Decorators/AbstractDecorateable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ public abstract class AbstractDecoratable<T> : AbstractBindable, IDecoratable<T>
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
Expand Down
4 changes: 2 additions & 2 deletions RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ internal E131DeviceInfo(E131DMXDeviceDefinition deviceDefinition)
this.Hostname = deviceDefinition.Hostname;
this.Port = deviceDefinition.Port;
this.Universe = deviceDefinition.Universe;

byte[]? cid = deviceDefinition.CID;
if ((cid == null) || (cid.Length != CID_LENGTH))
{
cid = new byte[CID_LENGTH];
new Random().NextBytes(cid);
}

CID = cid!;
CID = cid;

DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
}
Expand Down

0 comments on commit fab2c15

Please sign in to comment.