mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add universal pretty print method
This commit is contained in:
parent
2f95b8f6b2
commit
392bfcca2d
1 changed files with 12 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace Wox.Infrastructure
|
||||
{
|
||||
|
|
@ -63,5 +65,15 @@ namespace Wox.Infrastructure
|
|||
Directory.CreateDirectory(path);
|
||||
}
|
||||
}
|
||||
|
||||
public static string Formatted<T>(this T t)
|
||||
{
|
||||
var formatted = JsonConvert.SerializeObject(
|
||||
t,
|
||||
Formatting.Indented,
|
||||
new StringEnumConverter()
|
||||
);
|
||||
return formatted;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue