Skip to content

Commit 8a35bae

Browse files
Merge pull request #20 from andreaskueffel/development
update to net8 and add config editor
2 parents f9ca00b + 5b2d379 commit 8a35bae

15 files changed

Lines changed: 660 additions & 27 deletions

FileSyncApp/FileSyncApp.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
99
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
10-
<PackageReference Include="Serilog" Version="4.1.0" />
11-
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
10+
<PackageReference Include="Serilog" Version="4.2.0" />
11+
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
1212
<PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
1313
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
1414
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />

FileSyncApp/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ static void RunProgram()
129129
{
130130
Thread.Sleep(500);
131131
}
132+
foreach(var job in Jobs)
133+
{
134+
job.Value.StopJob();
135+
}
136+
Jobs.Clear();
132137
}
133138

134139

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net8.0-windows</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<UseWindowsForms>true</UseWindowsForms>
8+
<ImplicitUsings>enable</ImplicitUsings>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\FileSyncLibNet\FileSyncLibNet.csproj" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<None Update="config20250115.json">
21+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
22+
</None>
23+
</ItemGroup>
24+
25+
</Project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Newtonsoft.Json;
2+
using Newtonsoft.Json.Serialization;
3+
using System.Collections.Generic;
4+
using System.Reflection;
5+
6+
namespace FileSyncAppConfigEditor
7+
{
8+
//short helper class to ignore some properties from serialization
9+
public class IgnorePropertyResolver: DefaultContractResolver
10+
{
11+
private readonly HashSet<string> ignoreProps;
12+
public IgnorePropertyResolver(params string[] propNamesToIgnore)
13+
{
14+
this.ignoreProps = new HashSet<string>(propNamesToIgnore);
15+
}
16+
17+
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
18+
{
19+
JsonProperty property = base.CreateProperty(member, memberSerialization);
20+
if (this.ignoreProps.Contains(property.PropertyName))
21+
{
22+
property.ShouldSerialize = _ => false;
23+
}
24+
return property;
25+
}
26+
}
27+
}
28+

FileSyncAppConfigEditor/JobsEditForm.Designer.cs

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

0 commit comments

Comments
 (0)