mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
Merge branch 'Json' of Common/Utils into dev
This commit is contained in:
commit
30febd4a73
1 changed files with 9 additions and 7 deletions
|
|
@ -46,14 +46,16 @@ namespace ICD.Common.Utils.Extensions
|
|||
if (extends == null)
|
||||
throw new ArgumentNullException("extends");
|
||||
|
||||
string name;
|
||||
|
||||
if (type == null)
|
||||
name = null;
|
||||
else if (type.IsPrimitive)
|
||||
name = type.FullName;
|
||||
else
|
||||
name = type.AssemblyQualifiedName;
|
||||
{
|
||||
extends.WriteNull();
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the smallest possible name representation for the type that will still resolve
|
||||
string name = Type.GetType(type.FullName, false, true) == null
|
||||
? type.AssemblyQualifiedName
|
||||
: type.FullName;
|
||||
|
||||
extends.WriteValue(name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue