Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -3,6 +3,8 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Resources;
using System.Reflection;
// needed for ../referencesource/System.Data/System/Data/CodeGen/datacache.cs
internal static partial class Res
@@ -41,5 +43,13 @@ internal static partial class Res
internal static partial class SR
{
public static string GetResourceString(string resourceKey, string defaultString) => defaultString;
public static string GetResourceString(string resourceKey, string defaultString) {
Type fieldType = typeof(SR);
FieldInfo field = fieldType.GetField(resourceKey);
if (field != null) {
return field.GetValue(null).ToString();
}
return defaultString;
}
}