You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DataExchange/ReClass2007File.cs
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@
5
5
using System.Data;
6
6
using System.Data.SQLite;
7
7
using System.Linq;
8
+
using ReClassNET.Logger;
8
9
9
10
namespace ReClassNET.DataExchange
10
11
{
@@ -15,7 +16,7 @@ class ReClass2007File : IReClassImport
15
16
16
17
private Dictionary<int, SchemaClassNode> classes;
17
18
18
-
public SchemaBuilder Load(string filePath, ReportError report)
19
+
public SchemaBuilder Load(string filePath, ILogger logger)
19
20
{
20
21
try
21
22
{
@@ -36,7 +37,7 @@ public SchemaBuilder Load(string filePath, ReportError report)
36
37
var schema = classes
37
38
.Select(kv =>
38
39
{
39
-
kv.Value.Nodes.AddRange(Query(connection, $"SELECT variable, comment, type, length, ref FROM class{kv.Key} WHERE type != 2").AsEnumerable().Select(r => ReadNode(r, null)).Where(n => n != null));
40
+
kv.Value.Nodes.AddRange(Query(connection, $"SELECT variable, comment, type, length, ref FROM class{kv.Key} WHERE type != 2").AsEnumerable().Select(r => ReadNode(r, logger)).Where(n => n != null));
40
41
return kv.Value;
41
42
}).ToList();
42
43
@@ -45,7 +46,7 @@ public SchemaBuilder Load(string filePath, ReportError report)
45
46
}
46
47
catch (Exception ex)
47
48
{
48
-
report?.Invoke(ex.Message);
49
+
logger.Log(ex);
49
50
50
51
return null;
51
52
}
@@ -72,7 +73,7 @@ public SchemaBuilder Load(string filePath, ReportError report)
0 commit comments