mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
Extension method for writing a Type as a JSON value
This commit is contained in:
parent
cc34bcb19e
commit
29e1ef82bb
1 changed files with 15 additions and 0 deletions
|
|
@ -34,6 +34,21 @@ namespace ICD.Common.Utils.Extensions
|
||||||
jObject.WriteTo(extends, converter);
|
jObject.WriteTo(extends, converter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Writes the type value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="extends"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
[PublicAPI]
|
||||||
|
public static void WriteType(this JsonWriter extends, Type type)
|
||||||
|
{
|
||||||
|
if (extends == null)
|
||||||
|
throw new ArgumentNullException("extends");
|
||||||
|
|
||||||
|
string assemblyName = type == null ? null : type.AssemblyQualifiedName;
|
||||||
|
extends.WriteValue(assemblyName);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the current value as an integer.
|
/// Gets the current value as an integer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue