|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Diagnostics.Contracts; |
4 | | -using System.Drawing; |
5 | | -using System.Globalization; |
6 | 4 |
|
7 | 5 | namespace ReClassNET.Util |
8 | 6 | { |
@@ -52,69 +50,5 @@ public static void Swap<T>(ref T lhs, ref T rhs) |
52 | 50 | lhs = rhs; |
53 | 51 | rhs = temp; |
54 | 52 | } |
55 | | - |
56 | | - public static Size AggregateNodeSizes(Size baseSize, Size newSize) |
57 | | - { |
58 | | - return new Size(Math.Max(baseSize.Width, newSize.Width), baseSize.Height + newSize.Height); |
59 | | - } |
60 | | - |
61 | | - public static NumberFormatInfo GuessNumberFormat(string input) |
62 | | - { |
63 | | - Contract.Requires(input != null); |
64 | | - Contract.Ensures(Contract.Result<NumberFormatInfo>() != null); |
65 | | - |
66 | | - if (input.Contains(",") && !input.Contains(".")) |
67 | | - { |
68 | | - return new NumberFormatInfo |
69 | | - { |
70 | | - NumberDecimalSeparator = ",", |
71 | | - NumberGroupSeparator = "." |
72 | | - }; |
73 | | - } |
74 | | - return new NumberFormatInfo |
75 | | - { |
76 | | - NumberDecimalSeparator = ".", |
77 | | - NumberGroupSeparator = "," |
78 | | - }; |
79 | | - } |
80 | | - |
81 | | - private static readonly uint[] hexLookup = CreateHexLookup(); |
82 | | - |
83 | | - private static uint[] CreateHexLookup() |
84 | | - { |
85 | | - var result = new uint[256]; |
86 | | - for (var i = 0; i < 256; i++) |
87 | | - { |
88 | | - var s = i.ToString("X2"); |
89 | | - result[i] = (uint)s[0] + ((uint)s[1] << 16); |
90 | | - } |
91 | | - return result; |
92 | | - } |
93 | | - |
94 | | - public static string ByteArrayToHexString(byte[] data) |
95 | | - { |
96 | | - Contract.Requires(data != null); |
97 | | - |
98 | | - if (data.Length == 0) |
99 | | - { |
100 | | - return string.Empty; |
101 | | - } |
102 | | - |
103 | | - var lookup = hexLookup; |
104 | | - var result = new char[data.Length * 2 + data.Length - 1]; |
105 | | - |
106 | | - var val = lookup[data[0]]; |
107 | | - result[0] = (char)val; |
108 | | - result[1] = (char)(val >> 16); |
109 | | - |
110 | | - for (var i = 1; i < data.Length; i++) |
111 | | - { |
112 | | - val = lookup[data[i]]; |
113 | | - result[3 * i - 1] = ' '; |
114 | | - result[3 * i] = (char)val; |
115 | | - result[3 * i + 1] = (char)(val >> 16); |
116 | | - } |
117 | | - return new string(result); |
118 | | - } |
119 | 53 | } |
120 | 54 | } |
0 commit comments