diff --git a/Mystify/Bootstrapper.cs b/Mystify/Bootstrapper.cs index ad52015..4d8c0af 100644 --- a/Mystify/Bootstrapper.cs +++ b/Mystify/Bootstrapper.cs @@ -4,11 +4,12 @@ using LightweightIocContainer; using LightweightIocContainer.Interfaces; +using Mystify.Installers; namespace Mystify { public class Bootstrapper { - public IIocContainer BootstrapKernel() => new IocContainer().Install(); + public IIocContainer BootstrapKernel() => new IocContainer().Install(new NotifyIconInstaller()); } } \ No newline at end of file diff --git a/Mystify/Installers/NotifyIconInstaller.cs b/Mystify/Installers/NotifyIconInstaller.cs new file mode 100644 index 0000000..2067bd3 --- /dev/null +++ b/Mystify/Installers/NotifyIconInstaller.cs @@ -0,0 +1,21 @@ +// Author: Gockner, Simon +// Created: 2021-04-06 +// Copyright(c) 2021 SimonG. All Rights Reserved. + +using System.Runtime.InteropServices; +using Lib.NotifyIcon; +using Lib.NotifyIcon.Windows; +using LightweightIocContainer.Interfaces; +using LightweightIocContainer.Interfaces.Installers; + +namespace Mystify.Installers +{ + public class NotifyIconInstaller : IIocInstaller + { + public void Install(IIocContainer container) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + container.Register(); + } + } +} \ No newline at end of file diff --git a/Mystify/Mystify.csproj b/Mystify/Mystify.csproj index b2e7587..24d035d 100644 --- a/Mystify/Mystify.csproj +++ b/Mystify/Mystify.csproj @@ -15,4 +15,7 @@ + + +