use an enum

This commit is contained in:
mshafer1
2024-12-23 09:23:15 -06:00
parent 582eef1b9d
commit 52f315e4e3
3 changed files with 18 additions and 11 deletions

View File

@@ -1,10 +1,13 @@
using System;
using System.Windows.Forms;
using static ntfysh_client.SettingsModel;
namespace ntfysh_client
{
public partial class SettingsDialog : Form
{
public NotificationsType NotificationsMethod { get; set; }
public decimal Timeout
{
get => timeout.Value;
@@ -31,6 +34,7 @@ namespace ntfysh_client
{
useNativeWindowsNotifications.Checked = value;
groupCustomNotificationSettings.Enabled = !value;
NotificationsMethod = (value) ? NotificationsType.NativeWindows : NotificationsType.CustomTray;
}
}
@@ -40,6 +44,7 @@ namespace ntfysh_client
set {
useCustomTrayNotifications.Checked = value;
groupCustomNotificationSettings.Enabled = value;
NotificationsMethod = (value) ? NotificationsType.NativeWindows : NotificationsType.CustomTray;
}
}
#endregion