7b0b9c7365
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
43 lines
1.7 KiB
C#
43 lines
1.7 KiB
C#
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared;
|
|
|
|
public enum TemplateTreeNodeKind
|
|
{
|
|
Folder,
|
|
Template,
|
|
|
|
/// <summary>
|
|
/// Composition slot under a parent Template — produced only by callers that
|
|
/// supply <c>TemplateFolderTree.ExtraTemplateChildren</c>. The Transport
|
|
/// Export wizard intentionally never emits this kind (compositions aren't
|
|
/// independently exportable); the Templates page uses it to surface slots.
|
|
/// </summary>
|
|
Composition,
|
|
}
|
|
|
|
/// <summary>
|
|
/// Adapter node used by <c>TemplateFolderTree</c> to model the template-folder
|
|
/// hierarchy in a TreeView. Folder nodes carry sub-folders + their templates as
|
|
/// children; template nodes are leaves unless the caller injects extras via
|
|
/// <c>TemplateFolderTree.ExtraTemplateChildren</c> (e.g. composition slots).
|
|
/// </summary>
|
|
public sealed class TemplateTreeNode
|
|
{
|
|
/// <summary>Discriminator indicating whether this node represents a folder, template, or composition slot.</summary>
|
|
public required TemplateTreeNodeKind Kind { get; init; }
|
|
/// <summary>Database id of the underlying folder, template, or composition record.</summary>
|
|
public required int Id { get; init; }
|
|
/// <summary>Display name of the node.</summary>
|
|
public required string Name { get; init; }
|
|
/// <summary>Child nodes (sub-folders, templates, or composition slots).</summary>
|
|
public List<TemplateTreeNode> Children { get; } = new();
|
|
|
|
/// <summary>Stable key for TreeView selection / expansion tracking.</summary>
|
|
public string Key => Kind switch
|
|
{
|
|
TemplateTreeNodeKind.Folder => $"f:{Id}",
|
|
TemplateTreeNodeKind.Template => $"t:{Id}",
|
|
TemplateTreeNodeKind.Composition => $"c:{Id}",
|
|
_ => $"x:{Id}",
|
|
};
|
|
}
|