private IEnumerable <dynamic> GetLabels(JsonBuildingContext context) { var labels = context.Labels; if (labels.IsNullOrWhiteSpace()) { return(default);
private Layouts GetLayouts(JsonBuildingContext context) { return(new Layouts { Labels = this.GetLabels(context), Keymap = this.GetKeymap(context), }); }
private Lighting GetLighting(JsonBuildingContext context) { if (Enum.TryParse <Lighting>(context.Lighting, out var lighting)) { return(lighting); } return(Lighting.none); }
public string Build(JsonBuildingContext context) { var qcLayout = this.GetQcLayout(context.QmkConfJson); var physicalLayout = this.GetPhysicalLayout(context.Raw); var logicalLayout = this.GetLogicalLayout(context.Raw); var injected = this.InjectDesign(physicalLayout, qcLayout); var kles = this.ConvertToKleLayout(injected, logicalLayout); var json = this.FormatToJson(kles); return(json); }
private ViaModel GetViaModel(JsonBuildingContext context) { var name = context.Name; var vendorId = context.VendorId; var productId = context.ProductId; return(new ViaModel { Name = name, VenderId = vendorId, ProductId = productId, Lighting = this.GetLighting(context), Matrix = this.GetMatrix(context), Layouts = this.GetLayouts(context), }); }
public string Build(JsonBuildingContext context) { var model = this.GetViaModel(context); return(JsonSerializer.ToJsonString(model)); }