Skip to content

Commit 0010f8e

Browse files
Merge pull request #112 from ChristianGalla/105-add-wildcards-to-the-ignore-list
105 add wildcards to the ignore list
2 parents 3cce247 + 3b84c97 commit 0010f8e

File tree

180 files changed

+1648
-1092
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+1648
-1092
lines changed

AutoStartConfirm/App.xaml.cs

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
1-
using Microsoft.UI.Xaml;
2-
using Microsoft.UI.Xaml.Controls;
3-
using Microsoft.UI.Xaml.Controls.Primitives;
4-
using Microsoft.UI.Xaml.Data;
5-
using Microsoft.UI.Xaml.Input;
6-
using Microsoft.UI.Xaml.Media;
7-
using Microsoft.UI.Xaml.Navigation;
8-
using AutoStartConfirm.Connectors;
9-
using AutoStartConfirm.Notifications;
1+
using AutoStartConfirm.Business;
2+
using AutoStartConfirm.GUI;
3+
using AutoStartConfirm.Helpers;
104
using AutoStartConfirm.Models;
5+
using CommunityToolkit.Mvvm.DependencyInjection;
6+
using H.NotifyIcon;
7+
using Microsoft.Extensions.DependencyInjection;
8+
using Microsoft.Extensions.Logging;
9+
using Microsoft.Toolkit.Uwp.Notifications;
10+
using Microsoft.UI.Xaml;
1111
using System;
12+
using System.Diagnostics;
1213
using System.IO;
1314
using System.Threading.Tasks;
14-
using System.Diagnostics;
15-
using Windows.Foundation.Collections;
16-
using AutoStartConfirm.GUI;
17-
using AutoStartConfirm.Properties;
18-
using AutoStartConfirm.Update;
1915
using System.Xml.Serialization;
20-
using Microsoft.Extensions.Logging;
21-
using H.NotifyIcon;
22-
using CommunityToolkit.Mvvm.DependencyInjection;
23-
using Microsoft.Extensions.DependencyInjection;
24-
using Windows.UI.ViewManagement;
25-
using Microsoft.Toolkit.Uwp.Notifications;
26-
using Microsoft.UI.Dispatching;
27-
using AutoStartConfirm.Helpers;
28-
using AutoStartConfirm.Business;
16+
using Windows.Foundation.Collections;
2917

3018
namespace AutoStartConfirm
3119
{
@@ -237,17 +225,12 @@ private void ExitClicked(object sender, EventArgs e)
237225
}
238226

239227
#region Event handlers
240-
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
228+
protected override void OnLaunched(LaunchActivatedEventArgs args)
241229
{
242230
NotifyIcon.Exit += ExitHandler;
243231
NotifyIcon.ToggleMainWindow += ToggleMainWindowHandler;
244-
// disabled until https://github.com/HavenDV/H.NotifyIcon/issues/186 is fixed
245-
//TrayIcon = (TaskbarIcon)NotifyIcon["TrayIcon"];
246-
//TrayIcon.ForceCreate();
247-
DispatchService.TryEnqueue(() =>
248-
{
249-
Window?.Show();
250-
});
232+
TrayIcon = (TaskbarIcon)NotifyIcon["TrayIcon"];
233+
TrayIcon.ForceCreate();
251234

252235
// Listen to notification activation
253236
ToastNotificationManagerCompat.OnActivated += toastArgs =>
@@ -260,7 +243,8 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar
260243
ValueSet userInput = toastArgs.UserInput;
261244

262245
// Need to dispatch to UI thread if performing UI operations
263-
DispatchService.TryEnqueue(() => {
246+
DispatchService.TryEnqueue(() =>
247+
{
264248
Logger.LogTrace("Handling action {Arguments} {UserInput}", toastArgs.Argument, userInput);
265249
if (args.TryGetValue("action", out string? action))
266250
{

AutoStartConfirm/AutoStartConfirm.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net9.0-windows10.0.22000.0</TargetFramework>
4+
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
55
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
66
<ApplicationManifest>app.manifest</ApplicationManifest>
77
<Platforms>x64</Platforms>

AutoStartConfirm/Program.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading;
5-
using System.Threading.Tasks;
6-
using Windows.Storage;
7-
using Microsoft.Extensions.DependencyInjection;
8-
using Microsoft.Extensions.Logging;
1+
using AutoStartConfirm.Business;
92
using AutoStartConfirm.Connectors;
103
using AutoStartConfirm.GUI;
4+
using AutoStartConfirm.Helpers;
115
using AutoStartConfirm.Models;
126
using AutoStartConfirm.Notifications;
137
using AutoStartConfirm.Properties;
148
using AutoStartConfirm.Update;
15-
using NLog.Web;
9+
using CommunityToolkit.Mvvm.DependencyInjection;
10+
using Microsoft.Extensions.DependencyInjection;
11+
using Microsoft.Extensions.Logging;
1612
using Microsoft.UI.Dispatching;
17-
using System.IO;
1813
using Microsoft.Windows.AppLifecycle;
19-
using Windows.ApplicationModel.Activation;
20-
using CommunityToolkit.Mvvm.DependencyInjection;
21-
using AutoStartConfirm.Helpers;
22-
using NLog.Config;
2314
using NLog;
15+
using NLog.Web;
2416
using Octokit;
25-
using AutoStartConfirm.Business;
17+
using System;
18+
using System.Collections.Generic;
19+
using System.IO;
20+
using System.Linq;
21+
using System.Threading;
22+
using System.Threading.Tasks;
23+
using Windows.ApplicationModel.Activation;
24+
using Windows.Storage;
2625

2726
namespace AutoStartConfirm
2827
{
@@ -87,7 +86,7 @@ static int Main(string[] args)
8786

8887
private static void ConfigureServices(ServiceCollection services)
8988
{
90-
89+
9190
services
9291
.AddLogging(loggingBuilder =>
9392
{
@@ -97,7 +96,7 @@ private static void ConfigureServices(ServiceCollection services)
9796
loggingBuilder.AddNLogWeb((IServiceProvider serviceProvider) =>
9897
{
9998
var nlogPath = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "nlog.config");
100-
var logFactory = new NLog.LogFactory();
99+
var logFactory = new LogFactory();
101100
logFactory.Setup().LoadConfigurationFromFile(nlogPath);
102101
logFactory.ServiceRepository.RegisterService(typeof(IJsonConverter), new JsonNetSerializer());
103102
return logFactory;
@@ -114,7 +113,8 @@ private static void ConfigureServices(ServiceCollection services)
114113
.AddSingleton<IMessageService, MessageService>()
115114
.AddSingleton<ISettingsService, SettingsService>()
116115
.AddSingleton<IUpdateService, UpdateService>()
117-
.AddSingleton<IGitHubClient>(ServiceProvider => {
116+
.AddSingleton<IGitHubClient>(ServiceProvider =>
117+
{
118118
return new GitHubClient(new ProductHeaderValue("AutoStartConfirm"));
119119
});
120120
AutoStartConnectorService.ConfigureServices(services);

AutoStartConfirm/Properties/Settings.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,26 @@ namespace AutoStartConfirm.Properties
99
// The PropertyChanged event is raised after a setting's value is changed.
1010
// The SettingsLoaded event is raised after the setting values are loaded.
1111
// The SettingsSaving event is raised before the setting values are saved.
12-
internal sealed partial class Settings {
13-
14-
public Settings() {
12+
internal sealed partial class Settings
13+
{
14+
15+
public Settings()
16+
{
1517
// // To add event handlers for saving and changing settings, uncomment the lines below:
1618
//
1719
// this.SettingChanging += this.SettingChangingEventHandler;
1820
//
1921
// this.SettingsSaving += this.SettingsSavingEventHandler;
2022
//
2123
}
22-
23-
private void SettingChangingEventHandler(object sender, SettingChangingEventArgs e) {
24+
25+
private void SettingChangingEventHandler(object sender, SettingChangingEventArgs e)
26+
{
2427
// Add code to handle the SettingChangingEvent event here.
2528
}
26-
27-
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
29+
30+
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e)
31+
{
2832
// Add code to handle the SettingsSaving event here.
2933
}
3034
}

AutoStartConfirm/Properties/SettingsService.cs

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
using AutoStartConfirm.Notifications;
2-
using Microsoft.Extensions.Logging;
1+
using Microsoft.Extensions.Logging;
32
using System;
43
using System.Collections.Specialized;
54
using System.ComponentModel;
65
using System.Configuration;
76

87
namespace AutoStartConfirm.Properties
98
{
10-
public class SettingsService : ISettingsService, IDisposable {
9+
public class SettingsService : ISettingsService, IDisposable
10+
{
1111

1212
private readonly ILogger<SettingsService> Logger;
1313

@@ -16,9 +16,11 @@ public class SettingsService : ISettingsService, IDisposable {
1616
/// <summary>
1717
/// Ensures a valid configuration exists and upgrades configuration from a previous version if needed
1818
/// </summary>
19-
private void EnsureConfiguration() {
19+
private void EnsureConfiguration()
20+
{
2021
Logger.LogDebug("Ensuring configuration");
21-
if (Settings.Default.UpgradeRequired) {
22+
if (Settings.Default.UpgradeRequired)
23+
{
2224
Logger.LogInformation("Upgrading configuration");
2325
Settings.Default.Upgrade();
2426
Settings.Default.UpgradeRequired = false;
@@ -58,7 +60,8 @@ public bool CheckForUpdatesOnStart
5860
}
5961
}
6062

61-
public string LastNotifiedNewVersion {
63+
public string LastNotifiedNewVersion
64+
{
6265
get
6366
{
6467
return Settings.Default.LastNotifiedNewVersion;
@@ -96,7 +99,8 @@ public string LastNotifiedNewVersion {
9699
/// </summary>
97100
public void Save() => Settings.Default.Save();
98101

99-
public SettingsService(ILogger<SettingsService> logger) {
102+
public SettingsService(ILogger<SettingsService> logger)
103+
{
100104
Logger = logger;
101105
EnsureConfiguration();
102106
Settings.Default.SettingChanging += SettingChangingHandler;
@@ -105,15 +109,18 @@ public SettingsService(ILogger<SettingsService> logger) {
105109
Settings.Default.SettingsLoaded += SettingsLoadedHandler;
106110
}
107111

108-
private void SettingChangingHandler(object sender, SettingChangingEventArgs e) {
112+
private void SettingChangingHandler(object sender, SettingChangingEventArgs e)
113+
{
109114
SettingChanging?.Invoke(sender, e);
110115
}
111116

112-
private void PropertyChangedHandler(object? sender, PropertyChangedEventArgs e) {
117+
private void PropertyChangedHandler(object? sender, PropertyChangedEventArgs e)
118+
{
113119
PropertyChanged?.Invoke(sender, e);
114120
}
115121

116-
private void SettingsSavingHandler(object sender, CancelEventArgs e) {
122+
private void SettingsSavingHandler(object sender, CancelEventArgs e)
123+
{
117124
Logger.LogInformation("Settings saving");
118125
SettingsSaving?.Invoke(sender, e);
119126
}
@@ -124,9 +131,12 @@ private void SettingsLoadedHandler(object sender, SettingsLoadedEventArgs e)
124131
SettingsLoaded?.Invoke(sender, e);
125132
}
126133

127-
protected virtual void Dispose(bool disposing) {
128-
if (!disposedValue) {
129-
if (disposing) {
134+
protected virtual void Dispose(bool disposing)
135+
{
136+
if (!disposedValue)
137+
{
138+
if (disposing)
139+
{
130140
Settings.Default.SettingChanging -= SettingChangingHandler;
131141
Settings.Default.PropertyChanged -= PropertyChangedHandler;
132142
Settings.Default.SettingsSaving -= SettingsSavingHandler;
@@ -136,7 +146,8 @@ protected virtual void Dispose(bool disposing) {
136146
}
137147
}
138148

139-
public void Dispose() {
149+
public void Dispose()
150+
{
140151
Dispose(disposing: true);
141152
GC.SuppressFinalize(this);
142153
}

0 commit comments

Comments
 (0)