-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathTypeHelper.cs
More file actions
34 lines (29 loc) · 861 Bytes
/
Copy pathTypeHelper.cs
File metadata and controls
34 lines (29 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
namespace SyncPro.UI.Framework
{
using System;
using System.Linq;
using System.Reflection;
internal static class TypeHelper
{
public static bool PropertyImplementsInterface(PropertyInfo propInfo, Type interfaceType)
{
if (propInfo == null)
{
return false;
}
return ImplementsInterface(propInfo.PropertyType, interfaceType);
}
public static bool ImplementsInterface(Type instanceType, Type interfaceType)
{
if (instanceType == null)
{
return false;
}
if (instanceType == interfaceType)
{
return true;
}
return instanceType.GetInterfaces().Any(implementedType => implementedType == interfaceType);
}
}
}