diff --git a/.global.editorconfig.ini b/.global.editorconfig.ini index dd63746838..d5e10f1648 100644 --- a/.global.editorconfig.ini +++ b/.global.editorconfig.ini @@ -281,7 +281,7 @@ dotnet_diagnostic.MA0089.severity = error # Remove empty else/finally block dotnet_diagnostic.MA0090.severity = silent # Sender should be 'this' for instance events -dotnet_diagnostic.MA0091.severity = silent +dotnet_diagnostic.MA0091.severity = error # Sender should be 'null' for static events dotnet_diagnostic.MA0092.severity = error # EventArgs should not be null diff --git a/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs b/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs index 5f6a87faa1..1131d13f05 100644 --- a/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/EmuClientApi.cs @@ -55,6 +55,7 @@ namespace BizHawk.Client.Common public int BufferWidth() => VideoProvider.BufferWidth; +#pragma warning disable MA0091 // passing through `sender` is intentional private void CallBeforeQuickLoad(object sender, BeforeQuickLoadEventArgs args) => BeforeQuickLoad?.Invoke(sender, args); @@ -69,6 +70,7 @@ namespace BizHawk.Client.Common private void CallStateSaved(object sender, StateSavedEventArgs args) => StateSaved?.Invoke(sender, args); +#pragma warning restore MA0091 public void ClearAutohold() => _mainForm.ClearHolds(); diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index a9dc0b2444..75a5fe6736 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -1335,10 +1335,12 @@ namespace BizHawk.Client.EmuHawk } } +#pragma warning disable MA0091 // passing through `sender` is intentional private void DoRightMouseScroll(object sender, MouseEventArgs e) { RightMouseScrolled?.Invoke(sender, e); } +#pragma warning restore MA0091 private void ColumnClickEvent(RollColumn/*?*/ column) { @@ -1620,6 +1622,7 @@ namespace BizHawk.Client.EmuHawk Refresh(); } +#pragma warning disable MA0091 // unorthodox, but I think this is sound --yoshi if (_horizontalOrientation) { ColumnScroll?.Invoke(_hBar, e); @@ -1628,6 +1631,7 @@ namespace BizHawk.Client.EmuHawk { RowScroll?.Invoke(_vBar, e); } +#pragma warning restore MA0091 } private void HorizontalBar_ValueChanged(object sender, EventArgs e) @@ -1637,6 +1641,7 @@ namespace BizHawk.Client.EmuHawk Refresh(); } +#pragma warning disable MA0091 // unorthodox, but I think this is sound --yoshi if (_horizontalOrientation) { RowScroll?.Invoke(_hBar, e); @@ -1645,6 +1650,7 @@ namespace BizHawk.Client.EmuHawk { ColumnScroll?.Invoke(_vBar, e); } +#pragma warning restore MA0091 } private void ColumnChangedCallback() diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 7724034661..a91a5c4b90 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -4045,7 +4045,7 @@ namespace BizHawk.Client.EmuHawk ExtToolManager.BuildToolStrip(); - RomLoaded?.Invoke(null, EventArgs.Empty); + RomLoaded?.Invoke(this, EventArgs.Empty); return true; } else if (Emulator.IsNull()) @@ -4059,7 +4059,7 @@ namespace BizHawk.Client.EmuHawk else { // The ROM has been loaded by a recursive invocation of the LoadROM method. - RomLoaded?.Invoke(null, EventArgs.Empty); + RomLoaded?.Invoke(this, EventArgs.Empty); return true; } }