feat: Shim for JSON formatting a serializable instance

This commit is contained in:
Chris Cameron
2018-04-09 16:47:54 -04:00
parent 0fd8d91850
commit 5d0d491659

View File

@@ -107,9 +107,21 @@ namespace ICD.Common.Utils.Json
/// <param name="value"></param>
[PublicAPI]
public static void Print(object value)
{
string formatted = Format(value);
IcdConsole.PrintLine(formatted);
}
/// <summary>
/// Serializes the given item and formats the JSON into a human-readable form.
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
[PublicAPI]
public static string Format(object value)
{
string serial = JsonConvert.SerializeObject(value);
Print(serial);
return Format(serial);
}
/// <summary>