Made TypeNameHelper public (along with _builtInTypeNames
This commit is contained in:
parent
83f5f718d2
commit
b2c110a8b3
@ -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" },
|
||||||
@ -54,7 +54,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);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user