Started work on #1
This commit is contained in:
48
TwitchDesktopNotifications/Core/NotifyManager.cs
Normal file
48
TwitchDesktopNotifications/Core/NotifyManager.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TwitchDesktopNotifications.JsonStructure.Helix;
|
||||
|
||||
namespace TwitchDesktopNotifications.Core
|
||||
{
|
||||
internal class NotifyManager
|
||||
{
|
||||
|
||||
public Boolean shouldNotify(String streamerName)
|
||||
{
|
||||
return notifyAll || !DataStore.GetInstance().Store.SteamersToNotify.Streamers.Contains(streamerName);
|
||||
}
|
||||
|
||||
public void AddStreamerToNotifyList(String streamerName)
|
||||
{
|
||||
DataStore.GetInstance().Store.SteamersToNotify.Streamers.Add(streamerName);
|
||||
DataStore.GetInstance().Save();
|
||||
}
|
||||
|
||||
public void RemoveStreamerToNotifyList(String streamerName)
|
||||
{
|
||||
DataStore.GetInstance().Store.SteamersToNotify.Streamers.Remove(streamerName);
|
||||
DataStore.GetInstance().Save();
|
||||
}
|
||||
|
||||
public void ClearListOfEnabled()
|
||||
{
|
||||
DataStore.GetInstance().Store.SteamersToNotify.Streamers = new List<string>();
|
||||
DataStore.GetInstance().Save();
|
||||
}
|
||||
|
||||
public bool notifyAll
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataStore.GetInstance().Store.SteamersToNotify.notifyAll;
|
||||
}
|
||||
set {
|
||||
DataStore.GetInstance().Store.SteamersToNotify.notifyAll = value;
|
||||
DataStore.GetInstance().Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user