From 288105e3aa333f23be7b9267ed564a79fd7e7273 Mon Sep 17 00:00:00 2001 From: Simon G Date: Wed, 7 Apr 2021 13:22:18 +0200 Subject: [PATCH] - add and install notify icon --- Mystify/Bootstrapper.cs | 3 ++- Mystify/Installers/NotifyIconInstaller.cs | 21 +++++++++++++++++++++ Mystify/Mystify.csproj | 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 Mystify/Installers/NotifyIconInstaller.cs 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 @@ + + +