Sicherung
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user