UI - Restructured resources directory

UI - Fixed a few memory leaks
This commit is contained in:
Robert committed 2020-02-24 16:31:35 +01:00
1 parent f704e66296
commit 757ac68ea2
41 files changed
+215 -123

No files matched your search

@@ -1,7 +1,8 @@
using System.Windows.Input;
using System;
using System.Windows.Input;
using Artemis.Core.Events;
using Artemis.Core.Services.Interfaces;
using MaterialDesignExtensions.Controls;
using Ninject;
using Stylet;
namespace Artemis.UI.Screens.Splash
@@ -16,20 +17,10 @@ namespace Artemis.UI.Screens.Splash
_coreService = coreService;
_pluginService = pluginService;
Status = "Initializing Core";
ListenToEvents();
}
public string Status { get; set; }
public void ListenToEvents()
{
_coreService.Initialized += (sender, args) => Execute.OnUIThread(() => RequestClose());
_pluginService.CopyingBuildInPlugins += (sender, args) => Status = "Updating built-in plugins";
_pluginService.PluginLoading += (sender, args) => Status = "Loading plugin: " + args.PluginInfo.Name;
_pluginService.PluginLoaded += (sender, args) => Status = "Initializing UI";
}
// ReSharper disable once UnusedMember.Global - Called from view
public void MouseDown(object sender, MouseButtonEventArgs e)
{
@@ -37,5 +28,43 @@ namespace Artemis.UI.Screens.Splash
if (e.ChangedButton == MouseButton.Left)
((MaterialWindow) View).DragMove();
}
protected override void OnInitialActivate()
{
_coreService.Initialized += OnCoreServiceOnInitialized;
_pluginService.CopyingBuildInPlugins += OnPluginServiceOnCopyingBuildInPlugins;
_pluginService.PluginLoading += OnPluginServiceOnPluginLoading;
_pluginService.PluginLoaded += OnPluginServiceOnPluginLoaded;
base.OnInitialActivate();
}
protected override void OnClose()
{
_coreService.Initialized -= OnCoreServiceOnInitialized;
_pluginService.CopyingBuildInPlugins -= OnPluginServiceOnCopyingBuildInPlugins;
_pluginService.PluginLoading -= OnPluginServiceOnPluginLoading;
_pluginService.PluginLoaded -= OnPluginServiceOnPluginLoaded;
base.OnClose();
}
private void OnPluginServiceOnPluginLoaded(object? sender, PluginEventArgs args)
{
Status = "Initializing UI";
}
private void OnPluginServiceOnPluginLoading(object? sender, PluginEventArgs args)
{
Status = "Loading plugin: " + args.PluginInfo.Name;
}
private void OnPluginServiceOnCopyingBuildInPlugins(object? sender, EventArgs args)
{
Status = "Updating built-in plugins";
}
private void OnCoreServiceOnInitialized(object? sender, EventArgs args)
{
Execute.OnUIThread(() => RequestClose());
}
}
}