schema updates

This commit is contained in:
kay.one
2013-09-22 16:40:36 -07:00
committed by kayone
parent 1e88d2b7c3
commit 0eec2cd5f7
17 changed files with 199 additions and 107 deletions

View File

@@ -7,6 +7,8 @@ namespace NzbDrone.Common.Reflection
{
public static class ReflectionExtensions
{
public static readonly Assembly CoreAssembly = Assembly.Load("NzbDrone.Core");
public static List<PropertyInfo> GetSimpleProperties(this Type type)
{
var properties = type.GetProperties();
@@ -58,6 +60,11 @@ namespace NzbDrone.Common.Reflection
return (T)attribute;
}
public static Type FindTypeByName(this Assembly assembly, string name)
{
return assembly.GetTypes().Single(c => c.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
}
public static bool HasAttribute<TAttribute>(this Type type)
{
return type.GetCustomAttributes(typeof(TAttribute), true).Any();