43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace File_Folder_Helper.Models;
|
|
|
|
internal record VSCodeTask([property: JsonPropertyName("label")] string? Label,
|
|
[property: JsonPropertyName("command")] string? Command,
|
|
[property: JsonPropertyName("type")] string? Type,
|
|
[property: JsonPropertyName("args")] IReadOnlyList<string>? Arguments,
|
|
[property: JsonPropertyName("script")] string? Script)
|
|
{
|
|
|
|
public override string ToString()
|
|
{
|
|
string result = JsonSerializer.Serialize(this, VSCodeTaskSourceGenerationContext.Default.VSCodeTask);
|
|
return result;
|
|
}
|
|
|
|
}
|
|
|
|
[JsonSourceGenerationOptions(WriteIndented = true, PropertyNameCaseInsensitive = true)]
|
|
[JsonSerializable(typeof(VSCodeTask))]
|
|
internal partial class VSCodeTaskSourceGenerationContext : JsonSerializerContext
|
|
{
|
|
}
|
|
|
|
internal record VSCodeTasks([property: JsonPropertyName("version")] string? Version,
|
|
[property: JsonPropertyName("tasks")] VSCodeTask[]? TaskCollection)
|
|
{
|
|
|
|
public override string ToString()
|
|
{
|
|
string result = JsonSerializer.Serialize(this, VSCodeTasksSourceGenerationContext.Default.VSCodeTasks);
|
|
return result;
|
|
}
|
|
|
|
}
|
|
|
|
[JsonSourceGenerationOptions(WriteIndented = true, PropertyNameCaseInsensitive = true)]
|
|
[JsonSerializable(typeof(VSCodeTasks))]
|
|
internal partial class VSCodeTasksSourceGenerationContext : JsonSerializerContext
|
|
{
|
|
} |