add Uri parser, add ISerializationBinder

ISerializationBinder is added only in whitelist mode. Types for whitelisting should be registered manually via new API `Module.StartAsync()` or attribute `AllowedSerializableType(name)`
This commit is contained in:
2024-05-29 00:19:30 +03:00
parent af8efcbf4a
commit 920148e05b
7 changed files with 149 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
using BotFramework;
using System;
namespace Kruzya.TelegramBot.Core
{
public class AbsoluteUriParser : IParameterParser<Uri>
{
public Uri DefaultInstance() => null;
public bool TryGetValue(string text, out Uri result)
{
return Uri.TryCreate(text, UriKind.Absolute, out result);
}
}
}