Sicherung

This commit is contained in:
Maier Stephan SI
2023-01-02 04:33:49 +01:00
parent bea46135fd
commit d01747f75a
284 changed files with 6106 additions and 65112 deletions

View 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);
}
}
}