using System.Collections.Concurrent;
namespace HotelPms.Client.Blazor.Util
{
public class OptionCore : IDisposable
{
public enum GroupKey : int
{
System = 0,
}
public enum Key: int
{
System_CinTime = 0,
System_CoutTime,
System_CinTimeDayUse,
System_CoutTimeDayUse,
}
private static OptionCore m_Instance;
public static OptionCore Instance
{
get
{
if (m_Instance == null) { m_Instance = new OptionCore(); }
return m_Instance;
}
}
///
/// バッファー保存用メモリDB
///
public ConcurrentDictionary Data { get; set; } = new ConcurrentDictionary();
///
/// [Group,[Key, Value]]
///
public ConcurrentDictionary> DefaultData { get; set; } = new ConcurrentDictionary>();
public void Dispose()
{
Data.Clear();
}
public OptionCore()
{
InitDefault();
}
///
/// 初期値
///
private void InitDefault()
{
#region システム
ConcurrentDictionary itemDict = new();
DefaultData[GroupKey.System.ToString()] = itemDict;
itemDict[Key.System_CinTime.ToString()] = "1500";
itemDict[Key.System_CoutTime.ToString()] = "1000";
itemDict[Key.System_CinTimeDayUse.ToString()] = "0900";
itemDict[Key.System_CoutTimeDayUse.ToString()] = "1000";
#endregion
}
}
}