new object creation logic

This commit is contained in:
Bob
2010-09-20 21:58:46 +12:00
parent 61fd12c7da
commit 086bdfb4bd
3 changed files with 67 additions and 12 deletions

View File

@@ -73,5 +73,17 @@ namespace OpenRA
{
return mi.GetCustomAttributes(typeof(T), true).Length != 0;
}
public static T[] GetCustomAttributes<T>( this MemberInfo mi, bool inherit )
where T : class
{
return (T[])mi.GetCustomAttributes( typeof( T ), inherit );
}
public static T[] GetCustomAttributes<T>( this ParameterInfo mi )
where T : class
{
return (T[])mi.GetCustomAttributes( typeof( T ), true );
}
}
}