mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 05:15:43 +00:00
Fix exception message formatting in HasCustomAttribute
This commit is contained in:
parent
ba6c400a79
commit
164c4e4455
8
X10D/src/ExceptionMessages.Designer.cs
generated
8
X10D/src/ExceptionMessages.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
@ -160,7 +160,7 @@ namespace X10D {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {{0}} does not inherit {typeof(Attribute)}.
|
||||
/// Looks up a localized string similar to {0} does not inherit {1}.
|
||||
/// </summary>
|
||||
internal static string TypeDoesNotInheritAttribute {
|
||||
get {
|
||||
@ -169,7 +169,7 @@ namespace X10D {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {{0}} is not a class..
|
||||
/// Looks up a localized string similar to {0} is not a class..
|
||||
/// </summary>
|
||||
internal static string TypeIsNotClass {
|
||||
get {
|
||||
@ -178,7 +178,7 @@ namespace X10D {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {{0}} is not an interface..
|
||||
/// Looks up a localized string similar to {0} is not an interface..
|
||||
/// </summary>
|
||||
internal static string TypeIsNotInterface {
|
||||
get {
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
@ -27,13 +27,13 @@
|
||||
<value>The buffer is too small to contain the data.</value>
|
||||
</data>
|
||||
<data name="TypeIsNotClass" xml:space="preserve">
|
||||
<value>{{0}} is not a class.</value>
|
||||
<value>{0} is not a class.</value>
|
||||
</data>
|
||||
<data name="TypeIsNotInterface" xml:space="preserve">
|
||||
<value>{{0}} is not an interface.</value>
|
||||
<value>{0} is not an interface.</value>
|
||||
</data>
|
||||
<data name="TypeDoesNotInheritAttribute" xml:space="preserve">
|
||||
<value>{{0}} does not inherit {typeof(Attribute)}</value>
|
||||
<value>{0} does not inherit {1}</value>
|
||||
</data>
|
||||
<data name="HashAlgorithmNoCreateMethod" xml:space="preserve">
|
||||
<value>HashAlgorithm does not offer Create method.</value>
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Globalization;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
||||
namespace X10D.Reflection;
|
||||
@ -53,9 +53,8 @@ public static class MemberInfoExtensions
|
||||
|
||||
if (!attribute.Inherits<Attribute>())
|
||||
{
|
||||
throw new ArgumentException(
|
||||
string.Format(CultureInfo.CurrentCulture, ExceptionMessages.TypeDoesNotInheritAttribute, attribute),
|
||||
nameof(attribute));
|
||||
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ExceptionMessages.TypeDoesNotInheritAttribute,
|
||||
attribute, typeof(Attribute)), nameof(attribute));
|
||||
}
|
||||
|
||||
return member.GetCustomAttribute(attribute) is not null;
|
||||
|
Loading…
Reference in New Issue
Block a user