Skip to content

Commit e9553b0

Browse files
tylerkronclaude
andauthored
chore: codebase cleanup - remove legacy files and modernize C# syntax (#204)
Co-authored-by: Claude <[email protected]>
1 parent 0863195 commit e9553b0

Some content is hidden

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

42 files changed

+550
-850
lines changed

Daqifi.Desktop.Common.Test/UnitTest1.cs

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

Daqifi.Desktop.DataModel.Test/UnitTest1.cs

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

Daqifi.Desktop.Test/app.config

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
<assemblyIdentity name="EntityFramework.MappingAPI" publicKeyToken="7ee2e825d201459e" culture="neutral" />
77
<bindingRedirect oldVersion="0.0.0.0-6.1.0.9" newVersion="6.1.0.9" />
88
</dependentAssembly>
9-
<dependentAssembly>
10-
<assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral" />
11-
<bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
12-
</dependentAssembly>
139
<dependentAssembly>
1410
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
1511
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
1-
using System;
21
using System.Collections;
32
using System.Globalization;
43
using System.Linq;
54
using System.Windows.Data;
65

7-
namespace Daqifi.Desktop.Converters
6+
namespace Daqifi.Desktop.Converters;
7+
8+
/// <summary>
9+
/// Converts a list/collection to a comma-separated string
10+
/// </summary>
11+
public class ListToStringConverter : IValueConverter
812
{
9-
/// <summary>
10-
/// Converts a list/collection to a comma-separated string
11-
/// </summary>
12-
public class ListToStringConverter : IValueConverter
13+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
1314
{
14-
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15+
if (value == null)
16+
return string.Empty;
17+
18+
if (value is IEnumerable enumerable)
1519
{
16-
if (value == null)
20+
var items = enumerable.Cast<object>().ToList();
21+
if (items.Count == 0)
1722
return string.Empty;
1823

19-
if (value is IEnumerable enumerable)
24+
// Handle different formatting based on parameter
25+
var format = parameter?.ToString() ?? "default";
26+
27+
switch (format.ToLower())
2028
{
21-
var items = enumerable.Cast<object>().ToList();
22-
if (items.Count == 0)
23-
return string.Empty;
24-
25-
// Handle different formatting based on parameter
26-
var format = parameter?.ToString() ?? "default";
27-
28-
switch (format.ToLower())
29-
{
30-
case "brackets":
31-
return $"[{string.Join(", ", items)}]";
32-
case "short":
33-
// Limit to first 3 items for short display
34-
var shortItems = items.Take(3).ToList();
35-
var result = string.Join(",", shortItems);
36-
if (items.Count > 3)
37-
result += "...";
38-
return result;
39-
default:
40-
return string.Join(", ", items);
41-
}
29+
case "brackets":
30+
return $"[{string.Join(", ", items)}]";
31+
case "short":
32+
// Limit to first 3 items for short display
33+
var shortItems = items.Take(3).ToList();
34+
var result = string.Join(",", shortItems);
35+
if (items.Count > 3)
36+
result += "...";
37+
return result;
38+
default:
39+
return string.Join(", ", items);
4240
}
43-
44-
return value.ToString() ?? string.Empty;
4541
}
4642

47-
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
48-
{
49-
throw new NotImplementedException("ListToStringConverter does not support ConvertBack");
50-
}
43+
return value.ToString() ?? string.Empty;
44+
}
45+
46+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
47+
{
48+
throw new NotImplementedException("ListToStringConverter does not support ConvertBack");
5149
}
5250
}
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
using System;
21
using System.Globalization;
32
using System.Windows.Data;
43
using System.Windows.Media;
54
using OxyPlot;
65
using Brushes = System.Windows.Media.Brushes;
76
using Color = System.Windows.Media.Color;
87

9-
namespace Daqifi.Desktop.Converters
8+
namespace Daqifi.Desktop.Converters;
9+
10+
public class OxyColorToBrushConverter : IValueConverter
1011
{
11-
public class OxyColorToBrushConverter : IValueConverter
12+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
1213
{
13-
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14+
if (value is OxyColor oxyColor)
1415
{
15-
if (value is OxyColor oxyColor)
16-
{
17-
return new SolidColorBrush(Color.FromArgb(oxyColor.A, oxyColor.R, oxyColor.G, oxyColor.B));
18-
}
19-
return Brushes.Transparent; // Default or fallback
16+
return new SolidColorBrush(Color.FromArgb(oxyColor.A, oxyColor.R, oxyColor.G, oxyColor.B));
2017
}
18+
return Brushes.Transparent; // Default or fallback
19+
}
2120

22-
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23-
{
24-
throw new NotImplementedException();
25-
}
21+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22+
{
23+
throw new NotImplementedException();
2624
}
2725
}

Daqifi.Desktop/Daqifi.Desktop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<PackageReference Include="MahApps.Metro.IconPacks.Material" Version="5.1.0" />
6464
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.10" />
6565
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
66-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.10" />
66+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.10" />
6767
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
6868
<PrivateAssets>all</PrivateAssets>
6969
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

Daqifi.Desktop/Database/SqlCeBulkInsertProvider.cs

Lines changed: 0 additions & 143 deletions
This file was deleted.
-235 KB
Binary file not shown.
-459 KB
Binary file not shown.

Daqifi.Desktop/Database/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest

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

0 commit comments

Comments
 (0)