Files
ADP/UIShare/GlobalVariable/GlobalInfo.cs
2026-06-10 13:08:52 +08:00

42 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UIShare.GlobalVariable
{
public class GlobalInfo:BindableBase
{
public event EventHandler? ScopeChanged;
public Dictionary<string,ScopedContext> ContextDic { get; set; }
public Dictionary<string,StepRunning> StepRunningDic { get; set; }
public Dictionary<string, SystemConfig> ConfigDic { get; set; }
public Dictionary<string, IScopedProvider> ScopeDic { get; set; }
public String UserName { get; set; } = "Not Logged in";
public bool IsAdmin { get; set; } = true;
private string _currentScope = "default";
public string CurrentScope
{
get => _currentScope;
set
{
if (_currentScope != value)
{
_currentScope = value;
ScopeChanged?.Invoke(this, EventArgs.Empty);
}
}
}
public GlobalInfo()
{
ContextDic = new();
StepRunningDic = new();
ConfigDic = new();
ScopeDic = new();
CurrentScope = "default";
}
}
}