mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 13:06:24 +00:00
Fixed warnings
This commit is contained in:
1 parent
57dc9afb32
commit
a0a1521658
118 files changed
+802
-1181
No files matched your search
@@ -47,9 +47,9 @@ namespace RGB.NET.Devices.Novation
|
||||
/// Sends the specified message to the device this queue is performing updates for.
|
||||
/// </summary>
|
||||
/// <param name="message">The message to send.</param>
|
||||
protected virtual void SendMessage(ShortMessage message)
|
||||
protected virtual void SendMessage(ShortMessage? message)
|
||||
{
|
||||
if (message != null)
|
||||
if (message != null)
|
||||
_outputDevice.SendShort(message.Message);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace RGB.NET.Devices.Novation
|
||||
/// </summary>
|
||||
/// <param name="data">The data set to create the message from.</param>
|
||||
/// <returns>The message created out of the data set.</returns>
|
||||
protected abstract ShortMessage CreateMessage(KeyValuePair<object, Color> data);
|
||||
protected abstract ShortMessage? CreateMessage(KeyValuePair<object, Color> data);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Dispose()
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace RGB.NET.Devices.Novation
|
||||
/// The <see cref="MidiUpdateQueue"/> used to update this <see cref="NovationRGBDevice{TDeviceInfo}"/>.
|
||||
/// </summary>
|
||||
// ReSharper disable once MemberCanBePrivate.Global
|
||||
protected MidiUpdateQueue UpdateQueue { get; set; }
|
||||
protected MidiUpdateQueue? UpdateQueue { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace RGB.NET.Devices.Novation
|
||||
|
||||
if (Size == Size.Invalid)
|
||||
{
|
||||
Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
|
||||
Rectangle ledRectangle = new(this.Select(x => x.LedRectangle));
|
||||
Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
|
||||
}
|
||||
|
||||
@@ -71,12 +71,12 @@ namespace RGB.NET.Devices.Novation
|
||||
protected abstract void InitializeLayout();
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue.SetData(ledsToUpdate.Where(x => x.Color.A > 0));
|
||||
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue?.SetData(ledsToUpdate.Where(x => x.Color.A > 0));
|
||||
|
||||
/// <summary>
|
||||
/// Resets the <see cref="NovationRGBDevice{TDeviceInfo}"/> back to default.
|
||||
/// </summary>
|
||||
public virtual void Reset() => UpdateQueue.Reset();
|
||||
public virtual void Reset() => UpdateQueue?.Reset();
|
||||
|
||||
/// <inheritdoc cref="IDisposable.Dispose" />
|
||||
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}.Dispose" />
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace RGB.NET.Devices.Novation
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override ShortMessage CreateMessage(KeyValuePair<object, Color> data)
|
||||
protected override ShortMessage? CreateMessage(KeyValuePair<object, Color> data)
|
||||
{
|
||||
(byte mode, byte id) = ((byte, byte))data.Key;
|
||||
if (mode == 0x00) return null;
|
||||
|
||||
Reference in new issue
Block a user