Skip to content

Commit 10de978

Browse files
committed
added balloon
1 parent f54f655 commit 10de978

27 files changed

+626
-126
lines changed

Console/.config/dotnet-tools.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

Console/SoftU2F.Console.csproj

Lines changed: 0 additions & 31 deletions
This file was deleted.

SoftU2F.sln

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NativeBridge", "NativeBridg
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APDU", "APDU\APDU.csproj", "{011BE5F9-1916-4549-B307-779097C922AF}"
99
EndProject
10-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftU2F.Console", "Console\SoftU2F.Console.csproj", "{478BEBDF-ECF7-4153-B2AD-EBE549A93860}"
10+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoftU2FDriver", "SoftU2FDriver\SoftU2F.vcxproj", "{6480AC5C-E1DE-4855-B9EA-AFA0243EFE88}"
1111
EndProject
12-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoftU2F.Driver", "SoftU2FDriver\SoftU2F.vcxproj", "{6480AC5C-E1DE-4855-B9EA-AFA0243EFE88}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemTray", "SystemTray\SystemTray.csproj", "{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}"
1313
EndProject
1414
Global
1515
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -59,26 +59,6 @@ Global
5959
{011BE5F9-1916-4549-B307-779097C922AF}.Release|x64.Build.0 = Release|Any CPU
6060
{011BE5F9-1916-4549-B307-779097C922AF}.Release|x86.ActiveCfg = Release|Any CPU
6161
{011BE5F9-1916-4549-B307-779097C922AF}.Release|x86.Build.0 = Release|Any CPU
62-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|Any CPU.Build.0 = Debug|Any CPU
64-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|ARM.ActiveCfg = Debug|Any CPU
65-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|ARM.Build.0 = Debug|Any CPU
66-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|ARM64.ActiveCfg = Debug|Any CPU
67-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|ARM64.Build.0 = Debug|Any CPU
68-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|x64.ActiveCfg = Debug|Any CPU
69-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|x64.Build.0 = Debug|Any CPU
70-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|x86.ActiveCfg = Debug|Any CPU
71-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Debug|x86.Build.0 = Debug|Any CPU
72-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|Any CPU.ActiveCfg = Release|Any CPU
73-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|Any CPU.Build.0 = Release|Any CPU
74-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|ARM.ActiveCfg = Release|Any CPU
75-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|ARM.Build.0 = Release|Any CPU
76-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|ARM64.ActiveCfg = Release|Any CPU
77-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|ARM64.Build.0 = Release|Any CPU
78-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|x64.ActiveCfg = Release|Any CPU
79-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|x64.Build.0 = Release|Any CPU
80-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|x86.ActiveCfg = Release|Any CPU
81-
{478BEBDF-ECF7-4153-B2AD-EBE549A93860}.Release|x86.Build.0 = Release|Any CPU
8262
{6480AC5C-E1DE-4855-B9EA-AFA0243EFE88}.Debug|Any CPU.ActiveCfg = Debug|Win32
8363
{6480AC5C-E1DE-4855-B9EA-AFA0243EFE88}.Debug|ARM.ActiveCfg = Debug|ARM
8464
{6480AC5C-E1DE-4855-B9EA-AFA0243EFE88}.Debug|ARM.Build.0 = Debug|ARM
@@ -105,6 +85,26 @@ Global
10585
{6480AC5C-E1DE-4855-B9EA-AFA0243EFE88}.Release|x86.ActiveCfg = Release|Win32
10686
{6480AC5C-E1DE-4855-B9EA-AFA0243EFE88}.Release|x86.Build.0 = Release|Win32
10787
{6480AC5C-E1DE-4855-B9EA-AFA0243EFE88}.Release|x86.Deploy.0 = Release|Win32
88+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
89+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|Any CPU.Build.0 = Debug|Any CPU
90+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|ARM.ActiveCfg = Debug|Any CPU
91+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|ARM.Build.0 = Debug|Any CPU
92+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|ARM64.ActiveCfg = Debug|Any CPU
93+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|ARM64.Build.0 = Debug|Any CPU
94+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|x64.ActiveCfg = Debug|Any CPU
95+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|x64.Build.0 = Debug|Any CPU
96+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|x86.ActiveCfg = Debug|Any CPU
97+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Debug|x86.Build.0 = Debug|Any CPU
98+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|Any CPU.ActiveCfg = Release|Any CPU
99+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|Any CPU.Build.0 = Release|Any CPU
100+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|ARM.ActiveCfg = Release|Any CPU
101+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|ARM.Build.0 = Release|Any CPU
102+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|ARM64.ActiveCfg = Release|Any CPU
103+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|ARM64.Build.0 = Release|Any CPU
104+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|x64.ActiveCfg = Release|Any CPU
105+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|x64.Build.0 = Release|Any CPU
106+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|x86.ActiveCfg = Release|Any CPU
107+
{92ABFFCF-72BD-4AF8-A70D-CDE1731AC830}.Release|x86.Build.0 = Release|Any CPU
108108
EndGlobalSection
109109
GlobalSection(SolutionProperties) = preSolution
110110
HideSolutionNode = FALSE

SoftU2FDriver/SoftU2F.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<Configuration>Debug</Configuration>
6161
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
6262
<RootNamespace>SoftU2F</RootNamespace>
63-
<ProjectName>SoftU2F.Driver</ProjectName>
63+
<ProjectName>SoftU2FDriver</ProjectName>
6464
</PropertyGroup>
6565
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
6666
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

SystemTray/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
<Application x:Class="SoftU2F.Console.App"
1+
<Application x:Class="SystemTray.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:local="clr-namespace:SoftU2F.Console"
4+
xmlns:local="clr-namespace:SystemTray"
5+
56
ShutdownMode="OnExplicitShutdown">
67
<Application.Resources>
7-
8+
<ResourceDictionary Source="Properties/NotifyIconResources.xaml" />
89
</Application.Resources>
10+
911
</Application>
Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
using System.Configuration;
44
using System.Data;
55
using System.IO;
6-
using System.IO.IsolatedStorage;
76
using System.Linq;
87
using System.Threading;
98
using System.Threading.Tasks;
109
using System.Windows;
10+
using SystemTray.Storage;
11+
using Hardcodet.Wpf.TaskbarNotification;
1112
using Microsoft.EntityFrameworkCore;
12-
using Microsoft.Extensions.Configuration;
1313
using Microsoft.Extensions.DependencyInjection;
14-
using SoftU2F.Console.Storage;
1514
using U2FHID;
1615

17-
namespace SoftU2F.Console
16+
namespace SystemTray
1817
{
1918
/// <summary>
2019
/// Interaction logic for App.xaml
@@ -27,30 +26,46 @@ public partial class App : Application
2726

2827
private CancellationTokenSource _cancellation;
2928

29+
public TaskbarIcon NotifyIcon;
30+
3031
public App()
3132
{
3233
InitializeApplication();
3334
}
3435

36+
protected override void OnStartup(StartupEventArgs e)
37+
{
38+
base.OnStartup(e);
39+
NotifyIcon = (TaskbarIcon)FindResource("NotifyIcon");
40+
}
41+
42+
protected override void OnExit(ExitEventArgs e)
43+
{
44+
NotifyIcon.Dispose();
45+
base.OnExit(e);
46+
}
47+
3548
private void InitializeApplication()
3649
{
37-
using var db = new AppDbContext();
38-
db.Database.Migrate();
39-
var appData = db.ApplicationDatum.FirstOrDefault();
40-
if (appData == null)
50+
using (var db = new AppDbContext())
4151
{
42-
appData = new ApplicationData();
43-
appData.Counter = 0;
44-
db.ApplicationDatum.Add(appData);
45-
db.SaveChanges();
52+
db.Database.Migrate();
53+
var appData = db.ApplicationDatum.FirstOrDefault();
54+
if (appData == null)
55+
{
56+
appData = new ApplicationData();
57+
appData.Counter = 0;
58+
db.ApplicationDatum.Add(appData);
59+
db.SaveChanges();
60+
}
4661
}
4762

4863
var serviceCollection = new ServiceCollection();
4964
ConfigureServices(serviceCollection);
5065
ServiceProvider = serviceCollection.BuildServiceProvider();
5166

5267
_cancellation = new CancellationTokenSource();
53-
var u2fBackgroundTask = new U2FHIDBackgroundTask();
68+
var u2fBackgroundTask = new BackgroundTask();
5469
new Thread(() => { u2fBackgroundTask.StartIoLoop(_cancellation.Token); }).Start();
5570
}
5671

Console/Migrations/20190616192238_InitialCreate.Designer.cs renamed to SystemTray/Migrations/20190616192238_InitialCreate.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Console/Migrations/20190616192238_InitialCreate.cs renamed to SystemTray/Migrations/20190616192238_InitialCreate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Microsoft.EntityFrameworkCore.Migrations;
33

4-
namespace SoftU2F.Console.Migrations
4+
namespace SystemTray.Migrations
55
{
66
public partial class InitialCreate : Migration
77
{

Console/Migrations/AppDbContextModelSnapshot.cs renamed to SystemTray/Migrations/AppDbContextModelSnapshot.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// <auto-generated />
22
using System;
3+
using SystemTray.Storage;
34
using Microsoft.EntityFrameworkCore;
45
using Microsoft.EntityFrameworkCore.Infrastructure;
56
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
6-
using SoftU2F.Console.Storage;
77

8-
namespace SoftU2F.Console.Migrations
8+
namespace SystemTray.Migrations
99
{
1010
[DbContext(typeof(AppDbContext))]
1111
partial class AppDbContextModelSnapshot : ModelSnapshot

0 commit comments

Comments
 (0)