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;
|
}
|
}
|
|
/// <summary>
|
/// バッファー保存用メモリDB
|
/// </summary>
|
public ConcurrentDictionary<string, string> Data { get; set; } = new ConcurrentDictionary<string, string>();
|
|
/// <summary>
|
/// [Group,[Key, Value]]
|
/// </summary>
|
public ConcurrentDictionary<string, ConcurrentDictionary<string, string>> DefaultData { get; set; } = new ConcurrentDictionary<string, ConcurrentDictionary<string, string>>();
|
|
public void Dispose()
|
{
|
Data.Clear();
|
}
|
|
public OptionCore()
|
{
|
InitDefault();
|
}
|
|
/// <summary>
|
/// 初期値
|
/// </summary>
|
private void InitDefault()
|
{
|
#region システム
|
|
ConcurrentDictionary<string, string> 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
|
}
|
}
|
}
|