RescueExtensions
Namespace: Hex1b
Assembly: Hex1b.dll
Extension methods for building RescueWidget.
csharp
public static class RescueExtensionsInheritance
Object → RescueExtensions
Methods
Rescue<TParent>(WidgetContext<TParent>, Func<WidgetContext<VStackWidget>, Hex1bWidget[]>)
Wraps a VStack in a rescue boundary that catches exceptions and displays a fallback.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.childBuilder(Func<VStackWidget>, Hex1bWidget[]>): A builder function that creates VStack children.
Returns: RescueWidget
A new RescueWidget containing a VStack.
csharp
public static RescueWidget Rescue<TParent>(this WidgetContext<TParent> ctx, Func<WidgetContext<VStackWidget>, Hex1bWidget[]> childBuilder) where TParent : Hex1bWidgetRescue<TParent>(WidgetContext<TParent>, Hex1bWidget)
Wraps a widget in a rescue boundary that catches exceptions and displays a fallback.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.child(Hex1bWidget): The child widget to protect.
Returns: RescueWidget
A new RescueWidget.
csharp
public static RescueWidget Rescue<TParent>(this WidgetContext<TParent> ctx, Hex1bWidget child) where TParent : Hex1bWidgetRescueFriendly<TParent>(WidgetContext<TParent>, Hex1bWidget)
Wraps a widget in a rescue boundary with hidden exception details. Useful for production environments where you want a friendly error message.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.child(Hex1bWidget): The child widget to protect.
Returns: RescueWidget
A new RescueWidget with ShowDetails set to false.
csharp
public static RescueWidget RescueFriendly<TParent>(this WidgetContext<TParent> ctx, Hex1bWidget child) where TParent : Hex1bWidget