Skip to content

Commit

Permalink
Fix casting event senders to wrong base class
Browse files Browse the repository at this point in the history
fixes b2184e4
  • Loading branch information
YoshiRulz committed Dec 1, 2024
1 parent 6c49fa7 commit 9d3fc9c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/BizHawk.Client.EmuHawk/MainForm.VSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private void AppleDisksSubMenu_DropDownOpened(object sender, EventArgs e)
EventHandler clickHandler = (clickSender, _) =>
{
if (!object.ReferenceEquals(appleII, Emulator)) return;
appleII.SetDisk((int) ((Control) clickSender).Tag);
appleII.SetDisk((int) ((ToolStripItem) clickSender).Tag);
};
var selected = appleII.CurrentDisk;
for (int i = 0; i < appleII.DiskCount; i++)
Expand Down Expand Up @@ -146,7 +146,7 @@ private void C64DisksSubMenu_DropDownOpened(object sender, EventArgs e)
EventHandler clickHandler = (clickSender, _) =>
{
if (!object.ReferenceEquals(c64, Emulator)) return;
c64.SetDisk((int) ((Control) clickSender).Tag);
c64.SetDisk((int) ((ToolStripItem) clickSender).Tag);
};
var selected = c64.CurrentDisk;
for (int i = 0; i < c64.DiskCount; i++)
Expand Down Expand Up @@ -274,7 +274,7 @@ private void AmstradCpcTapesSubMenu_DropDownOpened(object sender, EventArgs e)
EventHandler clickHandler = (clickSender, _) =>
{
if (!object.ReferenceEquals(ams, Emulator)) return;
ams._machine.TapeMediaIndex = (int) ((Control) clickSender).Tag;
ams._machine.TapeMediaIndex = (int) ((ToolStripItem) clickSender).Tag;
};
var tapeMediaIndex = ams._machine.TapeMediaIndex;
for (int i = 0; i < ams._tapeInfo.Count; i++)
Expand All @@ -297,7 +297,7 @@ private void AmstradCpcDisksSubMenu_DropDownOpened(object sender, EventArgs e)
EventHandler clickHandler = (clickSender, _) =>
{
if (!object.ReferenceEquals(ams, Emulator)) return;
ams._machine.DiskMediaIndex = (int) ((Control) clickSender).Tag;
ams._machine.DiskMediaIndex = (int) ((ToolStripItem) clickSender).Tag;
};
var diskMediaIndex = ams._machine.DiskMediaIndex;
for (int i = 0; i < ams._diskInfo.Count; i++)
Expand Down Expand Up @@ -1005,7 +1005,7 @@ private void ZXSpectrumTapesSubMenu_DropDownOpened(object sender, EventArgs e)
EventHandler clickHandler = (clickSender, _) =>
{
if (!object.ReferenceEquals(speccy, Emulator)) return;
speccy._machine.TapeMediaIndex = (int) ((Control) clickSender).Tag;
speccy._machine.TapeMediaIndex = (int) ((ToolStripItem) clickSender).Tag;
};
var tapeMediaIndex = speccy._machine.TapeMediaIndex;
for (int i = 0; i < speccy._tapeInfo.Count; i++)
Expand All @@ -1028,7 +1028,7 @@ private void ZXSpectrumDisksSubMenu_DropDownOpened(object sender, EventArgs e)
EventHandler clickHandler = (clickSender, _) =>
{
if (!object.ReferenceEquals(speccy, Emulator)) return;
speccy._machine.DiskMediaIndex = (int) ((Control) clickSender).Tag;
speccy._machine.DiskMediaIndex = (int) ((ToolStripItem) clickSender).Tag;
};
var diskMediaIndex = speccy._machine.DiskMediaIndex;
for (int i = 0; i < speccy._diskInfo.Count; i++)
Expand Down

0 comments on commit 9d3fc9c

Please sign in to comment.