From 59f4e193d6bc138a35f09bc24d119729837b0a95 Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Sun, 18 Feb 2018 17:17:52 +0200 Subject: [PATCH] Code reorganization related to MediatR infrastructure --- .../ApplicationBase/IIocContainer.cs | 16 +++- .../ApplicationBase/LightInjectContainer.cs | 63 +++++++++---- Eve-O-Preview/Eve-O-Preview.csproj | 37 ++++---- .../Mediator/Implementation/Mediator.cs | 90 ------------------- Eve-O-Preview/Mediator/Interface/IMediator.cs | 20 ----- .../Mediator/Interface/INotification.cs | 10 --- .../Handlers/Services/StartServicesHandler.cs | 25 ++++++ .../Handlers/Services/StopServicesHandler.cs | 25 ++++++ .../Messages/Services/StartServices.cs | 8 ++ .../Mediatr/Messages/Services/StopServices.cs | 8 ++ Eve-O-Preview/Presentation/MainPresenter.cs | 10 ++- .../Presentation/ThumbnailManager.cs | 3 +- Eve-O-Preview/Program.cs | 12 ++- .../Implementation/DwmThumbnail.cs | 3 +- .../Implementation/WindowManager.cs | 3 +- .../Interface/IDwmThumbnail.cs | 2 +- .../Interface/IWindowManager.cs | 2 +- .../Interface/InteropConstants.cs | 2 +- .../Interop/DWM_BLURBEHIND.cs | 2 +- .../Interop/DWM_THUMBNAIL_PROPERTIES.cs | 2 +- .../Interop/DWM_TNP_CONSTANTS.cs | 2 +- .../Interop/DwmApiNativeMethods.cs | 2 +- .../Interop/MARGINS.cs | 2 +- .../Interop/RECT.cs | 2 +- .../Interop/User32NativeMethods.cs | 2 +- .../UI/Implementation/ThumbnailOverlay.cs | 2 +- .../UI/Implementation/ThumbnailView.cs | 2 +- Eve-O-Preview/app.config | 2 +- Eve-O-Preview/packages.config | 3 +- 29 files changed, 182 insertions(+), 180 deletions(-) delete mode 100644 Eve-O-Preview/Mediator/Implementation/Mediator.cs delete mode 100644 Eve-O-Preview/Mediator/Interface/IMediator.cs delete mode 100644 Eve-O-Preview/Mediator/Interface/INotification.cs create mode 100644 Eve-O-Preview/Mediatr/Handlers/Services/StartServicesHandler.cs create mode 100644 Eve-O-Preview/Mediatr/Handlers/Services/StopServicesHandler.cs create mode 100644 Eve-O-Preview/Mediatr/Messages/Services/StartServices.cs create mode 100644 Eve-O-Preview/Mediatr/Messages/Services/StopServices.cs rename Eve-O-Preview/{WindowManager => Services}/Implementation/DwmThumbnail.cs (91%) rename Eve-O-Preview/{WindowManager => Services}/Implementation/WindowManager.cs (91%) rename Eve-O-Preview/{WindowManager => Services}/Interface/IDwmThumbnail.cs (80%) rename Eve-O-Preview/{WindowManager => Services}/Interface/IWindowManager.cs (90%) rename Eve-O-Preview/{WindowManager => Services}/Interface/InteropConstants.cs (96%) rename Eve-O-Preview/{WindowManager => Services}/Interop/DWM_BLURBEHIND.cs (86%) rename Eve-O-Preview/{WindowManager => Services}/Interop/DWM_THUMBNAIL_PROPERTIES.cs (83%) rename Eve-O-Preview/{WindowManager => Services}/Interop/DWM_TNP_CONSTANTS.cs (83%) rename Eve-O-Preview/{WindowManager => Services}/Interop/DwmApiNativeMethods.cs (93%) rename Eve-O-Preview/{WindowManager => Services}/Interop/MARGINS.cs (84%) rename Eve-O-Preview/{WindowManager => Services}/Interop/RECT.cs (82%) rename Eve-O-Preview/{WindowManager => Services}/Interop/User32NativeMethods.cs (92%) diff --git a/Eve-O-Preview/ApplicationBase/IIocContainer.cs b/Eve-O-Preview/ApplicationBase/IIocContainer.cs index 273de67..e5b694c 100644 --- a/Eve-O-Preview/ApplicationBase/IIocContainer.cs +++ b/Eve-O-Preview/ApplicationBase/IIocContainer.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.Linq.Expressions; +using System.Reflection; namespace EveOPreview { @@ -8,11 +10,17 @@ namespace EveOPreview /// public interface IIocContainer { - void Register() where TImplementation : TService; + void Register() + where TImplementation : TService; + void Register(Type serviceType, Assembly container); void Register(); - void RegisterInstance(T instance); - TService Resolve(); - bool IsRegistered(); + void Register(Expression> factory); void Register(Expression> factory); + void RegisterInstance(TService instance); + TService Resolve(); + IEnumerable ResolveAll(); + object Resolve(Type serviceType); + IEnumerable ResolveAll(Type serviceType); + bool IsRegistered(); } } \ No newline at end of file diff --git a/Eve-O-Preview/ApplicationBase/LightInjectContainer.cs b/Eve-O-Preview/ApplicationBase/LightInjectContainer.cs index 31f9d6a..9805c05 100644 --- a/Eve-O-Preview/ApplicationBase/LightInjectContainer.cs +++ b/Eve-O-Preview/ApplicationBase/LightInjectContainer.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.Linq.Expressions; +using System.Reflection; using LightInject; namespace EveOPreview @@ -19,31 +21,38 @@ namespace EveOPreview return this._container.CanGetInstance(typeof(TService), ""); } - public void Register() + public void Register(Type serviceType, Assembly container) { - if (!typeof(TService).IsInterface) + if (!serviceType.IsInterface) { - this._container.Register(new PerContainerLifetime()); + this._container.Register(serviceType, new PerContainerLifetime()); return; } - foreach (Type implementationType in typeof(TService).Assembly.DefinedTypes) + if (serviceType.IsInterface && serviceType.IsGenericType) { - if (!implementationType.IsClass || implementationType.IsAbstract) - { - continue; - } - - if (!typeof(TService).IsAssignableFrom(implementationType)) - { - continue; - } - - this._container.Register(typeof(TService), implementationType, new PerContainerLifetime()); - break; + this._container.RegisterAssembly(container, (st, it) => st.IsConstructedGenericType && st.GetGenericTypeDefinition() == serviceType); } + else + { + foreach (TypeInfo implementationType in container.DefinedTypes) + { + if (!implementationType.IsClass || implementationType.IsAbstract) + { + continue; + } + if (serviceType.IsAssignableFrom(implementationType)) + { + this._container.Register(serviceType, implementationType, new PerContainerLifetime()); + } + } + } + } + public void Register() + { + this.Register(typeof(TService), typeof(TService).Assembly); } public void Register() @@ -52,12 +61,17 @@ namespace EveOPreview this._container.Register(new PerContainerLifetime()); } + public void Register(Expression> factory) + { + this._container.Register(f => factory); + } + public void Register(Expression> factory) { this._container.Register(f => factory); } - public void RegisterInstance(T instance) + public void RegisterInstance(TService instance) { this._container.RegisterInstance(instance); } @@ -66,5 +80,20 @@ namespace EveOPreview { return this._container.GetInstance(); } + + public IEnumerable ResolveAll() + { + return this._container.GetAllInstances(); + } + + public object Resolve(Type serviceType) + { + return this._container.GetInstance(serviceType); + } + + public IEnumerable ResolveAll(Type serviceType) + { + return this._container.GetAllInstances(serviceType); + } } } \ No newline at end of file diff --git a/Eve-O-Preview/Eve-O-Preview.csproj b/Eve-O-Preview/Eve-O-Preview.csproj index ecad15d..1a90dcd 100644 --- a/Eve-O-Preview/Eve-O-Preview.csproj +++ b/Eve-O-Preview/Eve-O-Preview.csproj @@ -10,7 +10,7 @@ Properties EveOPreview Eve-O Preview - v4.5.2 + v4.6 @@ -83,6 +83,10 @@ ..\packages\LightInject.5.1.2\lib\net452\LightInject.dll True + + ..\packages\MediatR.4.0.1\lib\net45\MediatR.dll + + R:\eve-o-preview\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll True @@ -110,26 +114,27 @@ + + + + - - - - - - - - - + + + + + + + + + - - - - - + + @@ -190,7 +195,7 @@ ThumbnailView.cs - + diff --git a/Eve-O-Preview/Mediator/Implementation/Mediator.cs b/Eve-O-Preview/Mediator/Implementation/Mediator.cs deleted file mode 100644 index fd841ea..0000000 --- a/Eve-O-Preview/Mediator/Implementation/Mediator.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Threading; - -namespace EveOPreview.Mediator.Implementation -{ - class Mediator : IMediator - { - #region Private fields - private readonly ReaderWriterLockSlim _lock; - private readonly IDictionary _handlers; - #endregion - - public Mediator() - { - this._lock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); - this._handlers = new Dictionary(); - } - - public void Subscribe(Action handler) - where T : INotification - { - this._lock.EnterWriteLock(); - try - { - IList handlers; - if (!this._handlers.TryGetValue(typeof(T), out handlers)) - { - handlers = new List>(); - this._handlers.Add(typeof(T), handlers); - } - - handlers.Add(handler); - } - finally - { - this._lock.ExitWriteLock(); - } - } - - public void Unsubscribe(Action handler) - where T : INotification - { - this._lock.EnterWriteLock(); - try - { - this._handlers.TryGetValue(typeof(T), out var handlers); - handlers?.Remove(handler); - } - finally - { - this._lock.ExitWriteLock(); - } - } - - public void Publish(T notification) - where T : INotification - { - // Empty notifications are silently swallowed - if (notification.IsEmpty()) - { - return; - } - - IList> handlers; - this._lock.EnterReadLock(); - try - { - if (!this._handlers.TryGetValue(typeof(T), out var untypedHandlers)) - { - return; - } - - // Clone the list to minimize lock time - // and possible deadlock issues (f.e. one of subscribers could raise an event ar add/remove subsctibers etc) - handlers = new List>((IList>)untypedHandlers); - } - finally - { - this._lock.ExitReadLock(); - } - - foreach (var handler in handlers) - { - handler.Invoke(notification); - } - } - } -} \ No newline at end of file diff --git a/Eve-O-Preview/Mediator/Interface/IMediator.cs b/Eve-O-Preview/Mediator/Interface/IMediator.cs deleted file mode 100644 index bba6d3d..0000000 --- a/Eve-O-Preview/Mediator/Interface/IMediator.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace EveOPreview.Mediator -{ - /// - /// Message dispatcher. - /// Consider this as a very simple message bus - /// - public interface IMediator - { - void Subscribe(Action handler) - where T : INotification; - - void Unsubscribe(Action handler) - where T : INotification; - - void Publish(T notification) - where T : INotification; - } -} \ No newline at end of file diff --git a/Eve-O-Preview/Mediator/Interface/INotification.cs b/Eve-O-Preview/Mediator/Interface/INotification.cs deleted file mode 100644 index 3f1f274..0000000 --- a/Eve-O-Preview/Mediator/Interface/INotification.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EveOPreview.Mediator -{ - /// - /// Base class for all Mediator notifications - /// - public interface INotification - { - bool IsEmpty(); - } -} \ No newline at end of file diff --git a/Eve-O-Preview/Mediatr/Handlers/Services/StartServicesHandler.cs b/Eve-O-Preview/Mediatr/Handlers/Services/StartServicesHandler.cs new file mode 100644 index 0000000..5520c3e --- /dev/null +++ b/Eve-O-Preview/Mediatr/Handlers/Services/StartServicesHandler.cs @@ -0,0 +1,25 @@ +using System.Threading; +using System.Threading.Tasks; +using EveOPreview.Mediator.Messages; +using EveOPreview.UI; +using MediatR; + +namespace EveOPreview.Mediator.Handlers +{ + sealed class StartServicesHandler : INotificationHandler + { + private readonly IThumbnailManager _manager; + + public StartServicesHandler(IThumbnailManager manager) + { + this._manager = manager; + } + + public Task Handle(StartServices message, CancellationToken cancellationToken) + { + this._manager.Activate(); + + return Task.CompletedTask; + } + } +} diff --git a/Eve-O-Preview/Mediatr/Handlers/Services/StopServicesHandler.cs b/Eve-O-Preview/Mediatr/Handlers/Services/StopServicesHandler.cs new file mode 100644 index 0000000..220c4ae --- /dev/null +++ b/Eve-O-Preview/Mediatr/Handlers/Services/StopServicesHandler.cs @@ -0,0 +1,25 @@ +using System.Threading; +using System.Threading.Tasks; +using EveOPreview.Mediator.Messages; +using EveOPreview.UI; +using MediatR; + +namespace EveOPreview.Mediator.Handlers +{ + sealed class StopServicesHandler : INotificationHandler + { + private readonly IThumbnailManager _manager; + + public StopServicesHandler(IThumbnailManager manager) + { + this._manager = manager; + } + + public Task Handle(StopServices message, CancellationToken cancellationToken) + { + this._manager.Deactivate(); + + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/Eve-O-Preview/Mediatr/Messages/Services/StartServices.cs b/Eve-O-Preview/Mediatr/Messages/Services/StartServices.cs new file mode 100644 index 0000000..98efdd5 --- /dev/null +++ b/Eve-O-Preview/Mediatr/Messages/Services/StartServices.cs @@ -0,0 +1,8 @@ +using MediatR; + +namespace EveOPreview.Mediator.Messages +{ + sealed class StartServices : INotification + { + } +} \ No newline at end of file diff --git a/Eve-O-Preview/Mediatr/Messages/Services/StopServices.cs b/Eve-O-Preview/Mediatr/Messages/Services/StopServices.cs new file mode 100644 index 0000000..dc8580d --- /dev/null +++ b/Eve-O-Preview/Mediatr/Messages/Services/StopServices.cs @@ -0,0 +1,8 @@ +using MediatR; + +namespace EveOPreview.Mediator.Messages +{ + sealed class StopServices : INotification + { + } +} diff --git a/Eve-O-Preview/Presentation/MainPresenter.cs b/Eve-O-Preview/Presentation/MainPresenter.cs index 0d3a98b..ce47f76 100644 --- a/Eve-O-Preview/Presentation/MainPresenter.cs +++ b/Eve-O-Preview/Presentation/MainPresenter.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using EveOPreview.Configuration; +using EveOPreview.Mediator.Messages; +using MediatR; namespace EveOPreview.UI { @@ -13,6 +15,7 @@ namespace EveOPreview.UI #endregion #region Private fields + private readonly IMediator _mediator; private readonly IThumbnailConfiguration _configuration; private readonly IConfigurationStorage _configurationStorage; private readonly IThumbnailDescriptionViewFactory _thumbnailDescriptionViewFactory; @@ -22,10 +25,11 @@ namespace EveOPreview.UI private bool _exitApplication; #endregion - public MainPresenter(IApplicationController controller, IMainView view, IThumbnailConfiguration configuration, IConfigurationStorage configurationStorage, + public MainPresenter(IApplicationController controller, IMainView view, IMediator mediator, IThumbnailConfiguration configuration, IConfigurationStorage configurationStorage, IThumbnailManager thumbnailManager, IThumbnailDescriptionViewFactory thumbnailDescriptionViewFactory) : base(controller, view) { + this._mediator = mediator; this._configuration = configuration; this._configurationStorage = configurationStorage; @@ -62,7 +66,7 @@ namespace EveOPreview.UI this.View.Minimize(); } - this._thumbnailManager.Activate(); + this._mediator.Publish(new StartServices()); } private void Minimize() @@ -79,6 +83,8 @@ namespace EveOPreview.UI { if (this._exitApplication || !this.View.MinimizeToTray) { + this._mediator.Publish(new StopServices()).Wait(); + this._thumbnailManager.Deactivate(); this._configurationStorage.Save(); request.Allow = true; diff --git a/Eve-O-Preview/Presentation/ThumbnailManager.cs b/Eve-O-Preview/Presentation/ThumbnailManager.cs index ca47111..96fe3ff 100644 --- a/Eve-O-Preview/Presentation/ThumbnailManager.cs +++ b/Eve-O-Preview/Presentation/ThumbnailManager.cs @@ -3,9 +3,8 @@ using System.Collections.Generic; using System.Drawing; using System.Windows.Threading; using EveOPreview.Configuration; -using EveOPreview.Mediator; using EveOPreview.Services; -using EveOPreview.WindowManager; +using MediatR; namespace EveOPreview.UI { diff --git a/Eve-O-Preview/Program.cs b/Eve-O-Preview/Program.cs index a439198..e891941 100644 --- a/Eve-O-Preview/Program.cs +++ b/Eve-O-Preview/Program.cs @@ -2,10 +2,9 @@ using System; using System.Threading; using System.Windows.Forms; using EveOPreview.Configuration; -using EveOPreview.Mediator; using EveOPreview.Services; using EveOPreview.UI; -using EveOPreview.WindowManager; +using MediatR; namespace EveOPreview { @@ -74,10 +73,17 @@ namespace EveOPreview // Singleton registration is used for services // Low-level services - container.Register(); container.Register(); container.Register(); + // MediatR + container.Register(); + container.RegisterInstance(t => container.Resolve(t)); + container.RegisterInstance(t => container.ResolveAll(t)); + container.Register(typeof(INotificationHandler<>), typeof(Program).Assembly); + container.Register(typeof(IRequestHandler<>), typeof(Program).Assembly); + container.Register(typeof(IRequestHandler<,>), typeof(Program).Assembly); + // Configuration services container.Register(); container.Register(); diff --git a/Eve-O-Preview/WindowManager/Implementation/DwmThumbnail.cs b/Eve-O-Preview/Services/Implementation/DwmThumbnail.cs similarity index 91% rename from Eve-O-Preview/WindowManager/Implementation/DwmThumbnail.cs rename to Eve-O-Preview/Services/Implementation/DwmThumbnail.cs index eff4bee..3345734 100644 --- a/Eve-O-Preview/WindowManager/Implementation/DwmThumbnail.cs +++ b/Eve-O-Preview/Services/Implementation/DwmThumbnail.cs @@ -1,6 +1,7 @@ using System; +using EveOPreview.Services.Interop; -namespace EveOPreview.WindowManager.Implementation +namespace EveOPreview.Services.Implementation { class DwmThumbnail : IDwmThumbnail { diff --git a/Eve-O-Preview/WindowManager/Implementation/WindowManager.cs b/Eve-O-Preview/Services/Implementation/WindowManager.cs similarity index 91% rename from Eve-O-Preview/WindowManager/Implementation/WindowManager.cs rename to Eve-O-Preview/Services/Implementation/WindowManager.cs index c4dd22b..927fa74 100644 --- a/Eve-O-Preview/WindowManager/Implementation/WindowManager.cs +++ b/Eve-O-Preview/Services/Implementation/WindowManager.cs @@ -1,6 +1,7 @@ using System; +using EveOPreview.Services.Interop; -namespace EveOPreview.WindowManager.Implementation +namespace EveOPreview.Services.Implementation { class WindowManager : IWindowManager { diff --git a/Eve-O-Preview/WindowManager/Interface/IDwmThumbnail.cs b/Eve-O-Preview/Services/Interface/IDwmThumbnail.cs similarity index 80% rename from Eve-O-Preview/WindowManager/Interface/IDwmThumbnail.cs rename to Eve-O-Preview/Services/Interface/IDwmThumbnail.cs index 3840a7e..31fabcd 100644 --- a/Eve-O-Preview/WindowManager/Interface/IDwmThumbnail.cs +++ b/Eve-O-Preview/Services/Interface/IDwmThumbnail.cs @@ -1,6 +1,6 @@ using System; -namespace EveOPreview.WindowManager +namespace EveOPreview.Services { public interface IDwmThumbnail { diff --git a/Eve-O-Preview/WindowManager/Interface/IWindowManager.cs b/Eve-O-Preview/Services/Interface/IWindowManager.cs similarity index 90% rename from Eve-O-Preview/WindowManager/Interface/IWindowManager.cs rename to Eve-O-Preview/Services/Interface/IWindowManager.cs index 522bf72..f646ae5 100644 --- a/Eve-O-Preview/WindowManager/Interface/IWindowManager.cs +++ b/Eve-O-Preview/Services/Interface/IWindowManager.cs @@ -1,6 +1,6 @@ using System; -namespace EveOPreview.WindowManager +namespace EveOPreview.Services { public interface IWindowManager { diff --git a/Eve-O-Preview/WindowManager/Interface/InteropConstants.cs b/Eve-O-Preview/Services/Interface/InteropConstants.cs similarity index 96% rename from Eve-O-Preview/WindowManager/Interface/InteropConstants.cs rename to Eve-O-Preview/Services/Interface/InteropConstants.cs index 814975c..e6df312 100644 --- a/Eve-O-Preview/WindowManager/Interface/InteropConstants.cs +++ b/Eve-O-Preview/Services/Interface/InteropConstants.cs @@ -1,6 +1,6 @@ using System; -namespace EveOPreview.WindowManager +namespace EveOPreview.Services { public static class InteropConstants { diff --git a/Eve-O-Preview/WindowManager/Interop/DWM_BLURBEHIND.cs b/Eve-O-Preview/Services/Interop/DWM_BLURBEHIND.cs similarity index 86% rename from Eve-O-Preview/WindowManager/Interop/DWM_BLURBEHIND.cs rename to Eve-O-Preview/Services/Interop/DWM_BLURBEHIND.cs index ff2c717..fd6423e 100644 --- a/Eve-O-Preview/WindowManager/Interop/DWM_BLURBEHIND.cs +++ b/Eve-O-Preview/Services/Interop/DWM_BLURBEHIND.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace EveOPreview.WindowManager.Implementation +namespace EveOPreview.Services.Interop { [StructLayout(LayoutKind.Sequential)] class DWM_BLURBEHIND diff --git a/Eve-O-Preview/WindowManager/Interop/DWM_THUMBNAIL_PROPERTIES.cs b/Eve-O-Preview/Services/Interop/DWM_THUMBNAIL_PROPERTIES.cs similarity index 83% rename from Eve-O-Preview/WindowManager/Interop/DWM_THUMBNAIL_PROPERTIES.cs rename to Eve-O-Preview/Services/Interop/DWM_THUMBNAIL_PROPERTIES.cs index a181020..e8f46cd 100644 --- a/Eve-O-Preview/WindowManager/Interop/DWM_THUMBNAIL_PROPERTIES.cs +++ b/Eve-O-Preview/Services/Interop/DWM_THUMBNAIL_PROPERTIES.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace EveOPreview.WindowManager.Implementation +namespace EveOPreview.Services.Interop { [StructLayout(LayoutKind.Sequential)] class DWM_THUMBNAIL_PROPERTIES diff --git a/Eve-O-Preview/WindowManager/Interop/DWM_TNP_CONSTANTS.cs b/Eve-O-Preview/Services/Interop/DWM_TNP_CONSTANTS.cs similarity index 83% rename from Eve-O-Preview/WindowManager/Interop/DWM_TNP_CONSTANTS.cs rename to Eve-O-Preview/Services/Interop/DWM_TNP_CONSTANTS.cs index 110744b..a426ff7 100644 --- a/Eve-O-Preview/WindowManager/Interop/DWM_TNP_CONSTANTS.cs +++ b/Eve-O-Preview/Services/Interop/DWM_TNP_CONSTANTS.cs @@ -1,4 +1,4 @@ -namespace EveOPreview.WindowManager.Implementation +namespace EveOPreview.Services.Interop { static class DWM_TNP_CONSTANTS { diff --git a/Eve-O-Preview/WindowManager/Interop/DwmApiNativeMethods.cs b/Eve-O-Preview/Services/Interop/DwmApiNativeMethods.cs similarity index 93% rename from Eve-O-Preview/WindowManager/Interop/DwmApiNativeMethods.cs rename to Eve-O-Preview/Services/Interop/DwmApiNativeMethods.cs index 2398f3c..90794e0 100644 --- a/Eve-O-Preview/WindowManager/Interop/DwmApiNativeMethods.cs +++ b/Eve-O-Preview/Services/Interop/DwmApiNativeMethods.cs @@ -2,7 +2,7 @@ using System; using System.Runtime.InteropServices; using System.Drawing; -namespace EveOPreview.WindowManager.Implementation +namespace EveOPreview.Services.Interop { static class DwmApiNativeMethods { diff --git a/Eve-O-Preview/WindowManager/Interop/MARGINS.cs b/Eve-O-Preview/Services/Interop/MARGINS.cs similarity index 84% rename from Eve-O-Preview/WindowManager/Interop/MARGINS.cs rename to Eve-O-Preview/Services/Interop/MARGINS.cs index 61b4b01..af132ff 100644 --- a/Eve-O-Preview/WindowManager/Interop/MARGINS.cs +++ b/Eve-O-Preview/Services/Interop/MARGINS.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace EveOPreview.WindowManager.Implementation +namespace EveOPreview.Services.Interop { [StructLayout(LayoutKind.Sequential)] class MARGINS diff --git a/Eve-O-Preview/WindowManager/Interop/RECT.cs b/Eve-O-Preview/Services/Interop/RECT.cs similarity index 82% rename from Eve-O-Preview/WindowManager/Interop/RECT.cs rename to Eve-O-Preview/Services/Interop/RECT.cs index a21a4e2..8582f90 100644 --- a/Eve-O-Preview/WindowManager/Interop/RECT.cs +++ b/Eve-O-Preview/Services/Interop/RECT.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace EveOPreview.WindowManager.Implementation +namespace EveOPreview.Services.Interop { [StructLayout(LayoutKind.Sequential)] struct RECT diff --git a/Eve-O-Preview/WindowManager/Interop/User32NativeMethods.cs b/Eve-O-Preview/Services/Interop/User32NativeMethods.cs similarity index 92% rename from Eve-O-Preview/WindowManager/Interop/User32NativeMethods.cs rename to Eve-O-Preview/Services/Interop/User32NativeMethods.cs index 03c3746..a216e0d 100644 --- a/Eve-O-Preview/WindowManager/Interop/User32NativeMethods.cs +++ b/Eve-O-Preview/Services/Interop/User32NativeMethods.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace EveOPreview.WindowManager.Implementation +namespace EveOPreview.Services.Interop { static class User32NativeMethods { diff --git a/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs b/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs index d0ac1f0..d2437c1 100644 --- a/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs +++ b/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs @@ -1,6 +1,6 @@ using System; using System.Windows.Forms; -using EveOPreview.WindowManager; +using EveOPreview.Services; namespace EveOPreview.UI { diff --git a/Eve-O-Preview/UI/Implementation/ThumbnailView.cs b/Eve-O-Preview/UI/Implementation/ThumbnailView.cs index cdc0e25..49d1dbb 100644 --- a/Eve-O-Preview/UI/Implementation/ThumbnailView.cs +++ b/Eve-O-Preview/UI/Implementation/ThumbnailView.cs @@ -2,8 +2,8 @@ using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; +using EveOPreview.Services; using EveOPreview.UI.Hotkeys; -using EveOPreview.WindowManager; namespace EveOPreview.UI { diff --git a/Eve-O-Preview/app.config b/Eve-O-Preview/app.config index 9c72f14..92ed828 100644 --- a/Eve-O-Preview/app.config +++ b/Eve-O-Preview/app.config @@ -1,3 +1,3 @@ - + diff --git a/Eve-O-Preview/packages.config b/Eve-O-Preview/packages.config index 1897299..f4ff496 100644 --- a/Eve-O-Preview/packages.config +++ b/Eve-O-Preview/packages.config @@ -2,6 +2,7 @@ - + + \ No newline at end of file