- add and install notify icon

master
Simon G 5 years ago
parent ec0e3a9bd1
commit 288105e3aa
  1. 3
      Mystify/Bootstrapper.cs
  2. 21
      Mystify/Installers/NotifyIconInstaller.cs
  3. 3
      Mystify/Mystify.csproj

@ -4,11 +4,12 @@
using LightweightIocContainer; using LightweightIocContainer;
using LightweightIocContainer.Interfaces; using LightweightIocContainer.Interfaces;
using Mystify.Installers;
namespace Mystify namespace Mystify
{ {
public class Bootstrapper public class Bootstrapper
{ {
public IIocContainer BootstrapKernel() => new IocContainer().Install(); public IIocContainer BootstrapKernel() => new IocContainer().Install(new NotifyIconInstaller());
} }
} }

@ -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<INotifyIcon, NotifyIcon>();
}
}
}

@ -15,4 +15,7 @@
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.0" /> <PackageReference Include="Avalonia.ReactiveUI" Version="0.10.0" />
<PackageReference Include="LightweightIocContainer" Version="3.0.0-beta" /> <PackageReference Include="LightweightIocContainer" Version="3.0.0-beta" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lib.NotifyIcon\Lib.NotifyIcon.csproj" />
</ItemGroup>
</Project> </Project>

Loading…
Cancel
Save