Skip to content

Commit f147b31

Browse files
committed
Use internal parse.
1 parent 9c03b88 commit f147b31

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

ReClass.NET/Forms/MainForm.Functions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Diagnostics;
44
using System.Diagnostics.Contracts;
5-
using System.Drawing;
65
using System.IO;
76
using System.Linq;
87
using System.Threading;
@@ -377,7 +376,6 @@ private void PasteNodeFromClipboardToSelection()
377376
var classNode = selectedNode.GetParentClass();
378377
if (containerNode != null && classNode != null)
379378
{
380-
381379
foreach (var node in result.Item2)
382380
{
383381
if (node is BaseWrapperNode)

ReClass.NET/Util/XElementSerializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public static bool TryRead(XContainer element, string name, Action<XElement> iff
2828
return false;
2929
}
3030

31-
public static bool ToBool(XElement value) => bool.Parse(value.Value);
32-
public static int ToInt(XElement value) => int.Parse(value.Value);
31+
public static bool ToBool(XElement value) => (bool?)value ?? false;
32+
public static int ToInt(XElement value) => (int?)value ?? 0;
3333
public static string ToString(XElement value) => value.Value;
3434
public static Color ToColor(XElement value) => Color.FromArgb((int)(0xFF000000 | int.Parse(value.Value, NumberStyles.HexNumber)));
3535
public static Dictionary<string, string> ToDictionary(XContainer value) => value.Elements().ToDictionary(e => e.Name.ToString(), e => e.Value);

0 commit comments

Comments
 (0)