From 9168b5938282b56d26c976565cb2ee4e36974711 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Mon, 21 Dec 2020 16:58:49 +1000 Subject: [PATCH] Add base interface for *CheckBoxEx and *RadioButtonEx controls --- src/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxExBase.cs | 2 +- src/BizHawk.WinForms.Controls/ICheckBoxOrRadioEx.cs | 7 +++++++ .../RadioButtonEx/RadioButtonExBase.cs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 src/BizHawk.WinForms.Controls/ICheckBoxOrRadioEx.cs diff --git a/src/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxExBase.cs b/src/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxExBase.cs index 6f76f94b8b..b3932e93cc 100644 --- a/src/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxExBase.cs +++ b/src/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxExBase.cs @@ -3,7 +3,7 @@ using System.Windows.Forms; namespace BizHawk.WinForms.Controls { - public abstract class CheckBoxExBase : CheckBox + public abstract class CheckBoxExBase : CheckBox, ICheckBoxOrRadioEx { [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] diff --git a/src/BizHawk.WinForms.Controls/ICheckBoxOrRadioEx.cs b/src/BizHawk.WinForms.Controls/ICheckBoxOrRadioEx.cs new file mode 100644 index 0000000000..94a00c6013 --- /dev/null +++ b/src/BizHawk.WinForms.Controls/ICheckBoxOrRadioEx.cs @@ -0,0 +1,7 @@ +namespace BizHawk.WinForms.Controls +{ + public interface ICheckBoxOrRadioEx + { + bool Checked { get; set; } + } +} diff --git a/src/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonExBase.cs b/src/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonExBase.cs index 64c5a6cb36..2d496e5cf9 100644 --- a/src/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonExBase.cs +++ b/src/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonExBase.cs @@ -3,7 +3,7 @@ using System.Windows.Forms; namespace BizHawk.WinForms.Controls { - public abstract class RadioButtonExBase : RadioButton, ITrackedRadioButton + public abstract class RadioButtonExBase : RadioButton, ICheckBoxOrRadioEx, ITrackedRadioButton { /// use to prevent recursion protected bool CheckedChangedCausedByTracker { get; private set; }