Class CompositeViewGenerator
Turns a ContainerNode region tree (from TemplateBuilder) into the actual asset graph: generated menu definitions, nested composite definitions, and the root composite, with navigation wired. Children are created before parents (parents reference child assets), ids are pre-checked for collisions, and a failure rolls back every asset created in the run.
Inherited Members
Namespace: Serenity.Ui.Infrastructure.Editor.Builder
Assembly: Serenity.UnityUi.Infrastructure.Editor.dll
Syntax
public static class CompositeViewGenerator
Methods
FindBatchDuplicate(ContainerNode)
Returns a message if two generated ids would clash within this run, else null (always blocking).
Declaration
public static string FindBatchDuplicate(ContainerNode root)
Parameters
| Type | Name | Description |
|---|---|---|
| ContainerNode | root | The root region tree. |
Returns
| Type | Description |
|---|---|
| string | The duplicate message, or null. |
FindExistingCollision(ContainerNode)
Returns a message if a generated id already exists as an asset, else null. Bypassed when overwriting.
Declaration
public static string FindExistingCollision(ContainerNode root)
Parameters
| Type | Name | Description |
|---|---|---|
| ContainerNode | root | The root region tree. |
Returns
| Type | Description |
|---|---|
| string | The collision message, or null. |
FindIdCollision(ContainerNode)
Returns the first generated id that already exists as a menu or composite asset, or null when all generated ids are free. Used by the window for up-front validation and by Generate(ContainerNode, string, bool, bool).
Declaration
public static string FindIdCollision(ContainerNode root)
Parameters
| Type | Name | Description |
|---|---|---|
| ContainerNode | root | The root region tree. |
Returns
| Type | Description |
|---|---|
| string | An error message describing the collision, or null. |
Generate(ContainerNode, string, bool, bool)
Generates the asset graph for root under folder.
Declaration
public static CompositeViewGenerator.Result Generate(ContainerNode root, string folder, bool setAsInitialView, bool overwrite = false)
Parameters
| Type | Name | Description |
|---|---|---|
| ContainerNode | root | The root region tree. |
| string | folder | Assets-relative folder (created if missing). |
| bool | setAsInitialView | When true, sets the app's single UI-settings InitialViewId to the root id. |
| bool | overwrite | When true, first deletes any existing menu/composite assets whose id matches a generated id, so the same screen can be regenerated in place. A within-batch duplicate id is still a hard error. |
Returns
| Type | Description |
|---|---|
| CompositeViewGenerator.Result | The result; on failure nothing is left on disk. |