Sicherung
This commit is contained in:
39
Config.Net/TypeParsers/ByteParser.cs
Normal file
39
Config.Net/TypeParsers/ByteParser.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class ByteParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(byte) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
if(value == null)
|
||||
{
|
||||
result = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
byte ir;
|
||||
bool parsed;
|
||||
if (value.StartsWith("0x"))
|
||||
{
|
||||
parsed = byte.TryParse(value.Substring(2), NumberStyles.HexNumber, TypeParserSettings.DefaultCulture, out ir);
|
||||
}
|
||||
else
|
||||
{
|
||||
parsed = byte.TryParse(value, NumberStyles.Integer, TypeParserSettings.DefaultCulture, out ir);
|
||||
}
|
||||
result = ir;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((byte?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
95
Config.Net/TypeParsers/CoreParsers.cs
Normal file
95
Config.Net/TypeParsers/CoreParsers.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for core types. Eventually all simple parsers will merge into this class.
|
||||
/// </summary>
|
||||
class CoreParsers : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(Uri), typeof(bool), typeof(Guid), typeof(DateTime) };
|
||||
|
||||
private static readonly Dictionary<string, bool> BooleanTrueValues =
|
||||
new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
{"true", true},
|
||||
{"yes", true},
|
||||
{"1", true},
|
||||
};
|
||||
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
if (value == null) return null;
|
||||
|
||||
Type t = value.GetType();
|
||||
|
||||
if(t == typeof(Uri))
|
||||
return value.ToString();
|
||||
|
||||
if(t == typeof(bool))
|
||||
return value?.ToString()?.ToLowerInvariant();
|
||||
|
||||
if (t == typeof(Guid))
|
||||
return value.ToString();
|
||||
|
||||
if(t == typeof(DateTime))
|
||||
return ((DateTime)value).ToUniversalTime().ToString("u");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
if(value == null)
|
||||
{
|
||||
result = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(t == typeof(Uri))
|
||||
{
|
||||
Uri uri = new Uri(value);
|
||||
result = uri;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(t == typeof(bool))
|
||||
{
|
||||
if(BooleanTrueValues.ContainsKey(value))
|
||||
{
|
||||
result = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
result = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(t == typeof(Guid))
|
||||
{
|
||||
if(Guid.TryParse(value, out Guid tg))
|
||||
{
|
||||
result = tg;
|
||||
return true;
|
||||
}
|
||||
|
||||
result = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(t == typeof(DateTime))
|
||||
{
|
||||
DateTime dateResult;
|
||||
bool parsed = DateTime.TryParse(value, TypeParserSettings.DefaultCulture, DateTimeStyles.None, out dateResult);
|
||||
result = dateResult;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
result = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Config.Net/TypeParsers/DecimalParser.cs
Normal file
26
Config.Net/TypeParsers/DecimalParser.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class DecimalParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(decimal) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
decimal dr;
|
||||
bool parsed = decimal.TryParse(value, NumberStyles.Float, TypeParserSettings.DefaultCulture, out dr);
|
||||
result = dr;
|
||||
return parsed;
|
||||
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((decimal?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
69
Config.Net/TypeParsers/DefaultParser.cs
Normal file
69
Config.Net/TypeParsers/DefaultParser.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class DefaultParser
|
||||
{
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
if(IsEnum(t))
|
||||
{
|
||||
if(value == null)
|
||||
{
|
||||
result = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
result = Enum.Parse(t, value, true);
|
||||
return true;
|
||||
}
|
||||
catch(ArgumentException)
|
||||
{
|
||||
|
||||
}
|
||||
catch(OverflowException)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
result = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public bool IsSupported(Type t)
|
||||
{
|
||||
return IsEnum(t);
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
if(value == null) return null;
|
||||
|
||||
Type t = value.GetType();
|
||||
|
||||
if(IsEnum(t))
|
||||
{
|
||||
return value.ToString();
|
||||
}
|
||||
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
static bool IsEnum(Type t)
|
||||
{
|
||||
if(t == null) return false;
|
||||
|
||||
//try to get the underlying type if this is a nullable type
|
||||
Type? nullable = Nullable.GetUnderlyingType(t);
|
||||
if(nullable != null) t = nullable;
|
||||
|
||||
return t.GetTypeInfo().IsEnum;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Config.Net/TypeParsers/DoubleParser.cs
Normal file
25
Config.Net/TypeParsers/DoubleParser.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class DoubleParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(double) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
double dr;
|
||||
bool parsed = double.TryParse(value, NumberStyles.Float, TypeParserSettings.DefaultCulture, out dr);
|
||||
result = dr;
|
||||
return parsed;
|
||||
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((double?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Config.Net/TypeParsers/FloatParser.cs
Normal file
26
Config.Net/TypeParsers/FloatParser.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class FloatParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(float) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
float dr;
|
||||
bool parsed = float.TryParse(value, NumberStyles.Float, TypeParserSettings.DefaultCulture, out dr);
|
||||
result = dr;
|
||||
return parsed;
|
||||
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((float?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Config.Net/TypeParsers/IntParser.cs
Normal file
24
Config.Net/TypeParsers/IntParser.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class IntParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(int) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
int ir;
|
||||
bool parsed = int.TryParse(value, NumberStyles.Integer, TypeParserSettings.DefaultCulture, out ir);
|
||||
result = ir;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((int?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Config.Net/TypeParsers/LongParser.cs
Normal file
24
Config.Net/TypeParsers/LongParser.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class LongParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(long) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
long lr;
|
||||
bool parsed = long.TryParse(value, NumberStyles.Integer, TypeParserSettings.DefaultCulture, out lr);
|
||||
result = lr;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((long?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Config.Net/TypeParsers/NetworkCredentialParser.cs
Normal file
24
Config.Net/TypeParsers/NetworkCredentialParser.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class NetworkCredentialParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(NetworkCredential) };
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
NetworkCredential? nc = value as NetworkCredential;
|
||||
return Utils.ToFriendlyString(nc);
|
||||
}
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
NetworkCredential? nc = value.ToNetworkCredential();
|
||||
result = nc;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Config.Net/TypeParsers/SByteParser.cs
Normal file
25
Config.Net/TypeParsers/SByteParser.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class SByteParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(sbyte) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
sbyte ir;
|
||||
bool parsed = sbyte.TryParse(value, NumberStyles.Integer, TypeParserSettings.DefaultCulture, out ir);
|
||||
result = ir;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((sbyte?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Config.Net/TypeParsers/ShortParser.cs
Normal file
25
Config.Net/TypeParsers/ShortParser.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class ShortParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(short) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
short ir;
|
||||
bool parsed = short.TryParse(value, NumberStyles.Integer, TypeParserSettings.DefaultCulture, out ir);
|
||||
result = ir;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((short?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
131
Config.Net/TypeParsers/StringArrayParser.cs
Normal file
131
Config.Net/TypeParsers/StringArrayParser.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class StringArrayParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(string[]) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
result = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
result = ParseAsArray(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool TryParse(string? value, out string[]? result)
|
||||
{
|
||||
if(value == null)
|
||||
{
|
||||
result = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
result = ParseAsArray(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
string[]? arv = (string[]?)value;
|
||||
|
||||
if (arv == null || arv.Length == 0) return null;
|
||||
|
||||
return string.Join(" ", arv.Select(Escape));
|
||||
}
|
||||
|
||||
private static string Escape(string s)
|
||||
{
|
||||
string s1 = s.Replace("\"", "\"\"");
|
||||
|
||||
return (s == s1 && !s.Contains(" "))
|
||||
? s
|
||||
: $"\"{s1}\"";
|
||||
}
|
||||
|
||||
private static string[] ParseAsArray(string s)
|
||||
{
|
||||
var a = new List<string>();
|
||||
string v = string.Empty;
|
||||
|
||||
int state = 0;
|
||||
for(int i = 0; i < s.Length;)
|
||||
{
|
||||
char ch = s[i];
|
||||
|
||||
switch(state)
|
||||
{
|
||||
case 0: //default
|
||||
if (ch == '\"')
|
||||
{
|
||||
state = 2;
|
||||
}
|
||||
else if(ch == ' ')
|
||||
{
|
||||
//skip spaces in default mode
|
||||
}
|
||||
else
|
||||
{
|
||||
v += ch;
|
||||
state = 1;
|
||||
}
|
||||
i++;
|
||||
break;
|
||||
case 1: //reading unquoted value
|
||||
if (ch == ' ')
|
||||
{
|
||||
a.Add(v);
|
||||
v = string.Empty;
|
||||
state = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
v += ch;
|
||||
}
|
||||
i++;
|
||||
break;
|
||||
case 2: //reading quoted value
|
||||
if(ch == '\"')
|
||||
{
|
||||
state = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
v += ch;
|
||||
}
|
||||
i++;
|
||||
break;
|
||||
|
||||
case 3: //after quote in quoted mode
|
||||
if (ch == '\"')
|
||||
{
|
||||
v += ch;
|
||||
state = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
a.Add(v);
|
||||
v = string.Empty;
|
||||
state = 0;
|
||||
}
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!string.IsNullOrEmpty(v))
|
||||
{
|
||||
a.Add(v);
|
||||
}
|
||||
|
||||
return a.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Config.Net/TypeParsers/StringParser.cs
Normal file
21
Config.Net/TypeParsers/StringParser.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class StringParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(string) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
result = value;
|
||||
return value != null;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return value as string;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Config.Net/TypeParsers/TimeSpanParser.cs
Normal file
23
Config.Net/TypeParsers/TimeSpanParser.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class TimeSpanParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(TimeSpan) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
TimeSpan ts;
|
||||
bool parsed = TimeSpan.TryParse(value, TypeParserSettings.DefaultCulture, out ts);
|
||||
result = ts;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((TimeSpan?)value)?.ToString(null, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Config.Net/TypeParsers/TypeParserSettings.cs
Normal file
11
Config.Net/TypeParsers/TypeParserSettings.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
internal static class TypeParserSettings
|
||||
{
|
||||
public const string DefaultNumericFormat = "G";
|
||||
|
||||
public static readonly CultureInfo DefaultCulture = CultureInfo.InvariantCulture;
|
||||
}
|
||||
}
|
||||
25
Config.Net/TypeParsers/UIntParser.cs
Normal file
25
Config.Net/TypeParsers/UIntParser.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class UIntParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(uint) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
uint ir;
|
||||
bool parsed = uint.TryParse(value, NumberStyles.Integer, TypeParserSettings.DefaultCulture, out ir);
|
||||
result = ir;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((uint?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Config.Net/TypeParsers/ULongParser.cs
Normal file
25
Config.Net/TypeParsers/ULongParser.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class ULongParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(ulong) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
ulong ir;
|
||||
bool parsed = ulong.TryParse(value, NumberStyles.Integer, TypeParserSettings.DefaultCulture, out ir);
|
||||
result = ir;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((ulong?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Config.Net/TypeParsers/UShortParser.cs
Normal file
25
Config.Net/TypeParsers/UShortParser.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Config.Net.TypeParsers
|
||||
{
|
||||
class UShortParser : ITypeParser
|
||||
{
|
||||
public IEnumerable<Type> SupportedTypes => new[] { typeof(ushort) };
|
||||
|
||||
public bool TryParse(string? value, Type t, out object? result)
|
||||
{
|
||||
ushort ir;
|
||||
bool parsed = ushort.TryParse(value, NumberStyles.Integer, TypeParserSettings.DefaultCulture, out ir);
|
||||
result = ir;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
public string? ToRawString(object? value)
|
||||
{
|
||||
return ((ushort?)value)?.ToString(TypeParserSettings.DefaultNumericFormat, TypeParserSettings.DefaultCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user