feat(centralui): BindingGroupBuilder.ApplyObject — per-module bulk rewrite to <object>.<member>, blank clears
This commit is contained in:
@@ -114,4 +114,22 @@ public static class BindingGroupBuilder
|
||||
}
|
||||
return any ? (candidate, false) : (null, false);
|
||||
}
|
||||
|
||||
/// <summary>Result of a bulk apply for one member.</summary>
|
||||
public sealed record BindingChange(string CanonicalName, int? ConnectionId, string? Override);
|
||||
|
||||
/// <summary>
|
||||
/// Rewrites every member of <paramref name="group"/> to
|
||||
/// <c>{objectPath}.{memberTail}</c> on <paramref name="connectionId"/>. A blank
|
||||
/// <paramref name="objectPath"/> clears the overrides (template default applies) and
|
||||
/// leaves the connection as given. Surrounding whitespace and a trailing '.' are tolerated.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<BindingChange> ApplyObject(BindingGroup group, int? connectionId, string? objectPath)
|
||||
{
|
||||
var obj = (objectPath ?? string.Empty).Trim().TrimEnd('.');
|
||||
return group.Members
|
||||
.Select(m => new BindingChange(m.Row.CanonicalName, connectionId,
|
||||
obj.Length == 0 ? null : obj + "." + m.MemberTail))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user