<data name="Arg_KeyNotFound" xml:space="preserve">
<value>The given key was not present in the dictionary.</value>
</data>
- <data name="Arg_KeyNotFoundWithKey" xml:space="preserve">
+ <data name="Arg_KeyNotFoundWithKey" xml:space="preserve">
<value>The given key '{0}' was not present in the dictionary.</value>
</data>
<data name="Arg_LongerThanDestArray" xml:space="preserve">
internal static void ThrowKeyNotFoundException(object key)
{
- throw new KeyNotFoundException(key.ToString());
+ throw GetKeyNotFoundException(key);
}
internal static void ThrowArgumentException(ExceptionResource resource)
return new ArgumentException(SR.Format(SR.Arg_WrongType, value, targetType), nameof(value));
}
+ private static KeyNotFoundException GetKeyNotFoundException(object key)
+ {
+ return new KeyNotFoundException(SR.Format(SR.Arg_KeyNotFoundWithKey, key.ToString()));
+ }
+
internal static ArgumentOutOfRangeException GetArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
{
return new ArgumentOutOfRangeException(GetArgumentName(argument), GetResourceString(resource));