-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebugHelper.cs
31 lines (27 loc) · 983 Bytes
/
DebugHelper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Optimizer
{
// Collection of useful debugging methods and utilities
internal sealed class DebugHelper
{
// For comparing and detecting missing keys between two translation JSON files
internal static void FindDifferenceInTwoJsons()
{
JObject file1 = JObject.Parse(Properties.Resources.EN);
JObject file2 = JObject.Parse(Properties.Resources.ID);
var p1 = file1.Properties().ToList();
var p2 = file2.Properties().ToList();
var missingProps = p1.Where(expected => !p2.Where(actual => actual.Name == expected.Name).Any());
StringBuilder sb = new StringBuilder();
foreach (var x in missingProps)
{
sb.Append(x.Name + Environment.NewLine);
}
MessageBox.Show(sb.ToString());
}
}
}