From cdf6249a41f33a02d0735e60fa1eb6e9507e953f Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 28 Feb 2013 20:10:47 -0100 Subject: [PATCH] Core - add some TypeExtensions --- src/Umbraco.Core/TypeExtensions.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Umbraco.Core/TypeExtensions.cs b/src/Umbraco.Core/TypeExtensions.cs index 4cab37051e..b7c079f384 100644 --- a/src/Umbraco.Core/TypeExtensions.cs +++ b/src/Umbraco.Core/TypeExtensions.cs @@ -264,6 +264,16 @@ namespace Umbraco.Core return TypeHelper.IsTypeAssignableFrom(actualType); } + public static bool Inherits(this Type type) + { + return typeof (TBase).IsAssignableFrom(type); + } + + public static bool Implements(this Type type) + { + return typeof (TInterface).IsAssignableFrom(type); + } + public static TAttribute FirstAttribute(this Type type) { return type.FirstAttribute(true);