[英]Need to find a suitable json schema for dynamic controls on windows forms
我正在開發一個在 Windows 窗體上放置動態控件的應用程序。 意圖是從 json 文件中讀取控件定義並將它們放置在窗口窗體中,特別是放入表格布局面板中。 是否有預定義的 json 模式,如column-formatting.schema但特定於 Windows 窗體。
我已經創建了這個用於定義 Windows 窗體控件的基本架構,它並不完整,但可以用作創建您自己的控件的基礎。
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "$schema": { "type": "string" }, "parent": { "type": "string" }, "controls": { "type": "array", "items": { "$ref": "#/definitions/Control" } } }, "definitions": { "Properties": { "type": "object", "properties": { "Type": { "enum": [ "Label", "TextBox" ] }, "Font": { "$ref": "#/definitions/Font" }, "Cell": { "$ref": "#/definitions/Cell" }, "TextAlign": { "$ref": "#/definitions/TextAlign" } } }, "Font": { "type": "object", "properties": { "Name": { "enum": [ "consolas", "arial" ] }, "Size": { "type": "integer" }, "Bold": { "type": "string" } } }, "TextAlign": { "enum": [ "Left", "Right", "TopLeft", "TopCenter", "TopRight", "MiddleLeft", "MiddleCenter", "MiddleRight", "BottomLeft", "BottomCenter", "BottomRight" ] }, "Cell": { "type": "object", "properties": { "Row": { "type": "integer" }, "Column": { "type": "integer" } } }, "Control": { "type": "object", "properties": { "properties": { "$ref": "#/definitions/Properties" } } } } }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.