mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-09 09:45:10 +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);
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// Gets the current value as an integer.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user