|
18 | 18 | #endregion |
19 | 19 |
|
20 | 20 | using System; |
21 | | -using System.Collections; |
22 | 21 | using System.Globalization; |
23 | 22 | using System.Reflection; |
24 | 23 | using System.Text; |
@@ -58,79 +57,6 @@ private OptionConverter() |
58 | 57 |
|
59 | 58 | #region Public Static Methods |
60 | 59 |
|
61 | | -// /// <summary> |
62 | | -// /// Concatenates two string arrays. |
63 | | -// /// </summary> |
64 | | -// /// <param name="l">Left array.</param> |
65 | | -// /// <param name="r">Right array.</param> |
66 | | -// /// <returns>Array containing both left and right arrays.</returns> |
67 | | -// public static string[] ConcatenateArrays(string[] l, string[] r) |
68 | | -// { |
69 | | -// return (string[])ConcatenateArrays(l, r); |
70 | | -// } |
71 | | - |
72 | | -// /// <summary> |
73 | | -// /// Concatenates two arrays. |
74 | | -// /// </summary> |
75 | | -// /// <param name="l">Left array</param> |
76 | | -// /// <param name="r">Right array</param> |
77 | | -// /// <returns>Array containing both left and right arrays.</returns> |
78 | | -// public static Array ConcatenateArrays(Array l, Array r) |
79 | | -// { |
80 | | -// if (l == null) |
81 | | -// { |
82 | | -// throw new ArgumentNullException("l"); |
83 | | -// } |
84 | | -// if (r == null) |
85 | | -// { |
86 | | -// throw new ArgumentNullException("r"); |
87 | | -// } |
88 | | -// |
89 | | -// int len = l.Length + r.Length; |
90 | | -// Array a = Array.CreateInstance(l.GetType(), len); |
91 | | -// |
92 | | -// Array.Copy(l, 0, a, 0, l.Length); |
93 | | -// Array.Copy(r, 0, a, l.Length, r.Length); |
94 | | -// |
95 | | -// return a; |
96 | | -// } |
97 | | - |
98 | | -// /// <summary> |
99 | | -// /// Converts string escape characters back to their correct values. |
100 | | -// /// </summary> |
101 | | -// /// <param name="s">String to convert.</param> |
102 | | -// /// <returns>Converted result.</returns> |
103 | | -// public static string ConvertSpecialChars(string s) |
104 | | -// { |
105 | | -// if (s == null) |
106 | | -// { |
107 | | -// throw new ArgumentNullException("s"); |
108 | | -// } |
109 | | -// char c; |
110 | | -// int len = s.Length; |
111 | | -// StringBuilder buf = new StringBuilder(len); |
112 | | -// |
113 | | -// int i = 0; |
114 | | -// while(i < len) |
115 | | -// { |
116 | | -// c = s[i++]; |
117 | | -// if (c == '\\') |
118 | | -// { |
119 | | -// c = s[i++]; |
120 | | -// if (c == 'n') c = '\n'; |
121 | | -// else if (c == 'r') c = '\r'; |
122 | | -// else if (c == 't') c = '\t'; |
123 | | -// else if (c == 'f') c = '\f'; |
124 | | -// else if (c == '\b') c = '\b'; |
125 | | -// else if (c == '\"') c = '\"'; |
126 | | -// else if (c == '\'') c = '\''; |
127 | | -// else if (c == '\\') c = '\\'; |
128 | | -// } |
129 | | -// buf.Append(c); |
130 | | -// } |
131 | | -// return buf.ToString(); |
132 | | -// } |
133 | | - |
134 | 60 | /// <summary> |
135 | 61 | /// Converts a string to a <see cref="bool" /> value. |
136 | 62 | /// </summary> |
@@ -160,35 +86,6 @@ public static bool ToBoolean(string argValue, bool defaultValue) |
160 | 86 | return defaultValue; |
161 | 87 | } |
162 | 88 |
|
163 | | -// /// <summary> |
164 | | -// /// Converts a string to an integer. |
165 | | -// /// </summary> |
166 | | -// /// <param name="argValue">String to convert.</param> |
167 | | -// /// <param name="defaultValue">The default value.</param> |
168 | | -// /// <returns>The <see cref="int" /> value of <paramref name="argValue" />.</returns> |
169 | | -// /// <remarks> |
170 | | -// /// <para> |
171 | | -// /// <paramref name="defaultValue"/> is returned when <paramref name="argValue"/> |
172 | | -// /// cannot be converted to a <see cref="int" /> value. |
173 | | -// /// </para> |
174 | | -// /// </remarks> |
175 | | -// public static int ToInt(string argValue, int defaultValue) |
176 | | -// { |
177 | | -// if (argValue != null) |
178 | | -// { |
179 | | -// string s = argValue.Trim(); |
180 | | -// try |
181 | | -// { |
182 | | -// return int.Parse(s, NumberFormatInfo.InvariantInfo); |
183 | | -// } |
184 | | -// catch (Exception e) |
185 | | -// { |
186 | | -// LogLog.Error(declaringType, "OptionConverter: [" + s + "] is not in proper int form.", e); |
187 | | -// } |
188 | | -// } |
189 | | -// return defaultValue; |
190 | | -// } |
191 | | - |
192 | 89 | /// <summary> |
193 | 90 | /// Parses a file size into a number. |
194 | 91 | /// </summary> |
|
0 commit comments