mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
78 lines
1.4 KiB
C#
78 lines
1.4 KiB
C#
|
using System;
|
|||
|
using Wabbajack.DTOs;
|
|||
|
using Wabbajack.Paths;
|
|||
|
|
|||
|
namespace Wabbajack.App.Blazor.State;
|
|||
|
|
|||
|
public class GlobalState
|
|||
|
{
|
|||
|
#region Navigation Allowed
|
|||
|
|
|||
|
private bool _navigationAllowed = true;
|
|||
|
|
|||
|
public event Action OnNavigationStateChange;
|
|||
|
|
|||
|
public bool NavigationAllowed
|
|||
|
{
|
|||
|
get => _navigationAllowed;
|
|||
|
set
|
|||
|
{
|
|||
|
_navigationAllowed = value;
|
|||
|
OnNavigationStateChange?.Invoke();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Install
|
|||
|
|
|||
|
private InstallStateEnum _installState;
|
|||
|
private AbsolutePath _modListPath;
|
|||
|
private ModList _modList;
|
|||
|
|
|||
|
public event Action OnModListPathChange;
|
|||
|
public event Action OnModListChange;
|
|||
|
public event Action OnInstallStateChange;
|
|||
|
|
|||
|
public AbsolutePath ModListPath
|
|||
|
{
|
|||
|
get => _modListPath;
|
|||
|
set
|
|||
|
{
|
|||
|
_modListPath = value;
|
|||
|
OnModListPathChange?.Invoke();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public ModList ModList
|
|||
|
{
|
|||
|
get => _modList;
|
|||
|
set
|
|||
|
{
|
|||
|
_modList = value;
|
|||
|
OnModListChange?.Invoke();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public InstallStateEnum InstallState
|
|||
|
{
|
|||
|
get => _installState;
|
|||
|
set
|
|||
|
{
|
|||
|
_installState = value;
|
|||
|
OnInstallStateChange?.Invoke();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public enum InstallStateEnum
|
|||
|
{
|
|||
|
Waiting,
|
|||
|
Configuration,
|
|||
|
Installing,
|
|||
|
Success,
|
|||
|
Failure
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|