You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`NumberBox<T>` is a single-line numeric editor built on the `TextEditorCore` infrastructure. It provides caret/selection/clipboard support like `TextBox`, while keeping a bindable numeric `Value`.
sb.Append(methodIndent).Append("/// Registers a dynamic update that assigns <see cref=\"").Append(receiverTypeXml).Append('.').Append(EscapeIdentifier(propName)).AppendLine("\"/> from a computed value and returns the same instance.");
sb.Append(methodIndent).AppendLine("/// The delegate is evaluated during the dynamic update pass; accessed bindings are tracked so only affected visuals are refreshed.");
sb.Append(methodIndent).AppendLine("/// <param name=\"obj\">The instance to configure.</param>");
528
-
sb.Append(methodIndent).Append("/// <param name=\"").Append(EscapeIdentifier(argName)).AppendLine("\">A delegate that computes the current value.</param>");
529
-
sb.Append(methodIndent).AppendLine("/// <returns>The same instance for chaining.</returns>");
sb.Append(methodIndent).Append("public static T ").Append(EscapeIdentifier(propName)).Append("<T>(this T obj, global::System.Func<").Append(argType).Append("> ").Append(EscapeIdentifier(argName))
534
-
.Append(") where T : ").Append(receiverType).AppendLine();
535
-
sb.Append(methodIndent).Append(" => global::XenoAtom.Terminal.UI.VisualExtensions.Update(obj, x => x.").Append(EscapeIdentifier(propName)).Append(" = ").Append(EscapeIdentifier(argName)).AppendLine("());");
536
-
}
537
-
else
524
+
// If the property itself is a delegate (e.g. Func<...>), avoid generating an overload taking
525
+
// Func<PropertyType>. It would compete with the natural "set the delegate" overload and complicate
sb.Append(methodIndent).Append("/// Registers a dynamic update that assigns <see cref=\"").Append(receiverTypeXml).Append('.').Append(EscapeIdentifier(propName)).AppendLine("\"/> from a computed value and returns the same instance.");
sb.Append(methodIndent).AppendLine("/// The delegate is evaluated during the dynamic update pass; accessed bindings are tracked so only affected visuals are refreshed.");
sb.Append(methodIndent).AppendLine("/// <param name=\"obj\">The instance to configure.</param>");
536
+
sb.Append(methodIndent).Append("/// <param name=\"").Append(EscapeIdentifier(argName)).AppendLine("\">A delegate that computes the current value.</param>");
537
+
sb.Append(methodIndent).AppendLine("/// <returns>The same instance for chaining.</returns>");
sb.Append(methodIndent).Append("public static T ").Append(EscapeIdentifier(propName)).Append("<T>(this T obj, global::System.Func<").Append(argType).Append("> ").Append(EscapeIdentifier(argName))
542
+
.Append(") where T : ").Append(receiverType).AppendLine();
543
+
sb.Append(methodIndent).Append(" => global::XenoAtom.Terminal.UI.VisualExtensions.Update(obj, x => x.").Append(EscapeIdentifier(propName)).Append(" = ").Append(EscapeIdentifier(argName)).AppendLine("());");
sb.Append(methodIndent).Append("/// Configures <see cref=\"").Append(receiverTypeXml).Append('.').Append(EscapeIdentifier(propName)).AppendLine("\"/> from a <see cref=\"global::XenoAtom.Terminal.UI.State{T}\"/> and returns the same instance.");
0 commit comments