mirror of
https://github.com/WowUp/WowUp.git
synced 2026-04-23 15:27:03 -04:00
+ new event which fires after a rescan or first start scan, fixes #40
This commit is contained in:
@@ -46,6 +46,7 @@ namespace WowUp.WPF.Services
|
||||
public event AddonEventHandler AddonInstalled;
|
||||
public event AddonEventHandler AddonUpdated;
|
||||
public event AddonStateEventHandler AddonStateChanged;
|
||||
public event AddonListUpdatedEventHandler AddonListUpdated;
|
||||
|
||||
public string BackupPath => Path.Combine(FileUtilities.AppDataPath, BackupFolder);
|
||||
|
||||
@@ -175,10 +176,10 @@ namespace WowUp.WPF.Services
|
||||
{
|
||||
var newAddons = await ScanAddons(clientType);
|
||||
addons = UpdateAddons(addons, newAddons);
|
||||
AddonListUpdated?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
await SyncAddons(clientType, addons);
|
||||
|
||||
return addons;
|
||||
}
|
||||
catch(Exception ex)
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace WowUp.WPF.Services.Contracts
|
||||
{
|
||||
public delegate void AddonEventHandler(object sender, AddonEventArgs e);
|
||||
public delegate void AddonStateEventHandler(object sender, AddonStateEventArgs e);
|
||||
public delegate void AddonListUpdatedEventHandler(object sender, EventArgs e);
|
||||
|
||||
public interface IAddonService
|
||||
{
|
||||
@@ -17,6 +18,7 @@ namespace WowUp.WPF.Services.Contracts
|
||||
event AddonEventHandler AddonInstalled;
|
||||
event AddonEventHandler AddonUpdated;
|
||||
event AddonStateEventHandler AddonStateChanged;
|
||||
event AddonListUpdatedEventHandler AddonListUpdated;
|
||||
|
||||
string BackupPath { get; }
|
||||
|
||||
|
||||
@@ -77,6 +77,11 @@ namespace WowUp.WPF.ViewModels
|
||||
OnRefresh();
|
||||
};
|
||||
|
||||
_addonService.AddonListUpdated += (sender, args) =>
|
||||
{
|
||||
OnRefresh();
|
||||
};
|
||||
|
||||
_sessionService.SessionChanged += (sender, args) =>
|
||||
{
|
||||
SelectedClientType = args.SessionState.SelectedClientType;
|
||||
|
||||
Reference in New Issue
Block a user