33 lines
693 B
C#
Raw Normal View History

2024-06-13 21:20:48 -04:00
namespace RemapperGUI.Utils;
internal static class GUI
{
2024-06-13 22:58:26 -04:00
/// <summary>
/// Returns the value of the count or null if disabled
/// </summary>
/// <param name="box"></param>
/// <returns></returns>
public static int? GetCount(this CheckBox box, NumericUpDown upDown)
2024-06-13 21:20:48 -04:00
{
2024-06-13 22:58:26 -04:00
if (box.Checked)
{
return (int?)upDown.Value;
}
return null;
2024-06-13 21:20:48 -04:00
}
2024-06-13 22:58:26 -04:00
public static bool? GetEnabled(this DomainUpDown domainUpDown)
2024-06-13 21:20:48 -04:00
{
2024-06-13 22:58:26 -04:00
if (domainUpDown.Text == "True")
{
return true;
}
else if (domainUpDown.Text == "False")
{
return false;
}
return null;
2024-06-13 21:20:48 -04:00
}
}