Typereaders finished, cleanup
This commit is contained in:
@ -21,6 +21,21 @@ namespace NadekoBot.Extensions
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
//so ftw
|
||||
public static bool IsSubclassOfRawGeneric(this Type toCheck, Type generic)
|
||||
{
|
||||
while (toCheck != null && toCheck != typeof(object))
|
||||
{
|
||||
var cur = toCheck.IsGenericType ? toCheck.GetGenericTypeDefinition() : toCheck;
|
||||
if (generic == cur)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
toCheck = toCheck.BaseType;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static async Task<string> ReplaceAsync(this Regex regex, string input, Func<Match, Task<string>> replacementFn)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
Reference in New Issue
Block a user