Merge pull request #42 from georgeduckett/master

Make TypeNameHelper public, rather than internal
This commit is contained in:
Ben Adams 2018-02-22 17:18:00 +00:00 committed by GitHub
commit 7381924470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,12 +4,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace System.Diagnostics.Internal namespace System.Diagnostics
{ {
// Adapted from https://github.com/aspnet/Common/blob/dev/shared/Microsoft.Extensions.TypeNameHelper.Sources/TypeNameHelper.cs // Adapted from https://github.com/aspnet/Common/blob/dev/shared/Microsoft.Extensions.TypeNameHelper.Sources/TypeNameHelper.cs
internal class TypeNameHelper public class TypeNameHelper
{ {
private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string> public static readonly Dictionary<Type, string> BuiltInTypeNames = new Dictionary<Type, string>
{ {
{ typeof(void), "void" }, { typeof(void), "void" },
{ typeof(bool), "bool" }, { typeof(bool), "bool" },
@ -70,7 +70,7 @@ namespace System.Diagnostics.Internal
{ {
ProcessArrayType(builder, type, options); ProcessArrayType(builder, type, options);
} }
else if (_builtInTypeNames.TryGetValue(type, out var builtInName)) else if (BuiltInTypeNames.TryGetValue(type, out var builtInName))
{ {
builder.Append(builtInName); builder.Append(builtInName);
} }