Skip to content

Commit 80ef3d8

Browse files
add FileSyncAppConfigEditor
1 parent 090ae06 commit 80ef3d8

6 files changed

Lines changed: 548 additions & 0 deletions

File tree

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)