mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-22 23:58:48 +00:00
Move reflection extensions to Reflection namespace (#7)
This commit is contained in:
parent
f7b5ef49c8
commit
6d80ee7a6d
@ -1,7 +1,7 @@
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
||||
namespace X10D;
|
||||
namespace X10D.Reflection;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="MemberInfo" />.
|
||||
@ -76,8 +76,7 @@ public static class MemberInfoExtensions
|
||||
/// -or-
|
||||
/// <paramref name="selector" /> is <see langword="null" />.
|
||||
/// </exception>
|
||||
public static TReturn? SelectFromCustomAttribute<TAttribute, TReturn>(
|
||||
this MemberInfo member,
|
||||
public static TReturn? SelectFromCustomAttribute<TAttribute, TReturn>(this MemberInfo member,
|
||||
Func<TAttribute, TReturn> selector)
|
||||
where TAttribute : Attribute
|
||||
{
|
@ -1,7 +1,6 @@
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
||||
namespace X10D;
|
||||
namespace X10D.Reflection;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="Type" />.
|
||||
@ -40,7 +39,7 @@ public static class TypeExtensions
|
||||
if (!interfaceType.IsInterface)
|
||||
{
|
||||
string? exceptionMessage = ExceptionMessages.TypeIsNotInterface;
|
||||
string? formattedMessage = string.Format(CultureInfo.CurrentCulture, exceptionMessage, interfaceType);
|
||||
string formattedMessage = string.Format(CultureInfo.CurrentCulture, exceptionMessage, interfaceType);
|
||||
|
||||
throw new ArgumentException(formattedMessage, nameof(interfaceType));
|
||||
}
|
||||
@ -87,7 +86,7 @@ public static class TypeExtensions
|
||||
if (!value.IsClass)
|
||||
{
|
||||
string? exceptionMessage = ExceptionMessages.TypeIsNotClass;
|
||||
string? formattedMessage = string.Format(CultureInfo.CurrentCulture, exceptionMessage, value);
|
||||
string formattedMessage = string.Format(CultureInfo.CurrentCulture, exceptionMessage, value);
|
||||
|
||||
throw new ArgumentException(formattedMessage, nameof(value));
|
||||
}
|
||||
@ -95,7 +94,7 @@ public static class TypeExtensions
|
||||
if (!type.IsClass)
|
||||
{
|
||||
string? exceptionMessage = ExceptionMessages.TypeIsNotClass;
|
||||
string? formattedMessage = string.Format(CultureInfo.CurrentCulture, exceptionMessage, type);
|
||||
string formattedMessage = string.Format(CultureInfo.CurrentCulture, exceptionMessage, type);
|
||||
|
||||
throw new ArgumentException(formattedMessage, nameof(type));
|
||||
}
|
Loading…
Reference in New Issue
Block a user