summary refs log tree commit diff
path: root/crypto/src/util/TypeExtensions.cs
blob: 203d0a605bea6bf3656cb921b906b979a8c73ca8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#if NEW_REFLECTION

using System;
using System.Reflection;

namespace Org.BouncyCastle.Utilities
{
    internal static class TypeExtensions
    {
        public static bool IsInstanceOfType(this Type type, object instance)
        {
            return instance != null && type.GetTypeInfo().IsAssignableFrom(instance.GetType().GetTypeInfo());
        }
    }
}

#endif