mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +00:00
Extension method for writing a Type as a JSON value
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user