You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.5 KiB
31 lines
1.5 KiB
using StabilityMatrix.Core.Models.Update; |
|
|
|
namespace StabilityMatrix.Core.Helper; |
|
|
|
public class EventManager |
|
{ |
|
public static EventManager Instance { get; } = new(); |
|
|
|
private EventManager() |
|
{ |
|
|
|
} |
|
|
|
public event EventHandler<int>? GlobalProgressChanged; |
|
public event EventHandler<Type>? PageChangeRequested; |
|
public event EventHandler? InstalledPackagesChanged; |
|
public event EventHandler<bool>? OneClickInstallFinished; |
|
public event EventHandler? TeachingTooltipNeeded; |
|
public event EventHandler<bool>? DevModeSettingChanged; |
|
public event EventHandler<UpdateInfo>? UpdateAvailable; |
|
public event EventHandler<Guid> PackageLaunchRequested; |
|
public void OnGlobalProgressChanged(int progress) => GlobalProgressChanged?.Invoke(this, progress); |
|
public void RequestPageChange(Type pageType) => PageChangeRequested?.Invoke(this, pageType); |
|
public void OnInstalledPackagesChanged() => InstalledPackagesChanged?.Invoke(this, EventArgs.Empty); |
|
public void OnOneClickInstallFinished(bool skipped) => OneClickInstallFinished?.Invoke(this, skipped); |
|
public void OnTeachingTooltipNeeded() => TeachingTooltipNeeded?.Invoke(this, EventArgs.Empty); |
|
public void OnDevModeSettingChanged(bool value) => DevModeSettingChanged?.Invoke(this, value); |
|
public void OnUpdateAvailable(UpdateInfo args) => UpdateAvailable?.Invoke(this, args); |
|
public void OnPackageLaunchRequested(Guid packageId) => |
|
PackageLaunchRequested?.Invoke(this, packageId); |
|
}
|
|
|