Moved direct WinAPI access into a service

This commit is contained in:
Anton Kasyanov
2018-02-03 21:09:15 +02:00
parent 2e6d3ffb4d
commit 16f934df62
18 changed files with 299 additions and 170 deletions

View File

@@ -20,7 +20,7 @@ namespace EveOPreview
// during the app lifetime
object token = Program.GetInstanceToken();
// If it was not possible to aquite the app token then another app instance is already running
// If it was not possible to aquire the app token then another app instance is already running
// Nothing to do here
if (token == null)
{
@@ -87,8 +87,7 @@ namespace EveOPreview
}
catch (Exception)
{
bool result;
Mutex token = new Mutex(true, Program.MutexName, out result);
Mutex token = new Mutex(true, Program.MutexName, out var result);
return result ? token : null;
}
}
@@ -115,6 +114,7 @@ namespace EveOPreview
.RegisterService<IThumbnailViewFactory, ThumbnailViewFactory>()
.RegisterService<IThumbnailDescriptionViewFactory, ThumbnailDescriptionViewFactory>()
.RegisterService<IConfigurationStorage, ConfigurationStorage>()
.RegisterService<IWindowManager, EveOPreview.DwmAPI.WindowManager>()
.RegisterInstance<IAppConfig>(new AppConfig())
.RegisterInstance<IThumbnailConfig>(new ThumbnailConfig());