File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
using System . Collections ;
2
2
using System . Collections . Specialized ;
3
+ using System . Diagnostics ;
3
4
using System . Numerics ;
4
5
5
6
namespace Htmxor . Http ;
6
7
7
8
/// <summary>
8
9
/// A builder class for constructing a swap style command string for HTMX responses.
9
10
/// </summary>
11
+ [ DebuggerDisplay ( "{ToString(),nq}" ) ]
10
12
public sealed class SwapStyleBuilder
11
13
{
12
14
private readonly SwapStyle style ;
@@ -311,6 +313,17 @@ public SwapStyleBuilder ShowNone()
311
313
return this ;
312
314
}
313
315
316
+ /// <inheritdoc/>
317
+ public override string ToString ( )
318
+ {
319
+ var ( swapStyle , modifier ) = Build ( ) ;
320
+ var style = swapStyle . ToHtmxString ( ) ;
321
+ var value = ! string . IsNullOrWhiteSpace ( modifier )
322
+ ? $ "{ style } { modifier } "
323
+ : style ;
324
+ return value ;
325
+ }
326
+
314
327
/// <summary>
315
328
/// Builds the swap style command string with all specified modifiers.
316
329
/// </summary>
You can’t perform that action at this time.
0 commit comments