Skip to content

Commit 390df90

Browse files
committed
Add remaining XML doc
1 parent baa52e6 commit 390df90

File tree

104 files changed

+1813
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1813
-49
lines changed

samples/ControlsDemo/Demos/RadioButtonDemo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public override Visual Build(DemoContext context)
1515
// Radio buttons are grouped by an arbitrary key object.
1616
var group = new object();
1717

18-
var a = new RadioButton("Choice A").Group(group).IsChecked(true);
19-
var b = new RadioButton("Choice B").Group(group);
20-
var c = new RadioButton("Choice C").Group(group);
18+
var a = new RadioButton("Choice A").GroupBy(group).IsChecked(true);
19+
var b = new RadioButton("Choice B").GroupBy(group);
20+
var c = new RadioButton("Choice C").GroupBy(group);
2121

2222
string Selected()
2323
{

src/XenoAtom.Terminal.UI/Controls/Center.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212

1313
namespace XenoAtom.Terminal.UI.Controls;
1414

15+
/// <summary>
16+
/// Centers its content within the available bounds.
17+
/// </summary>
1518
public sealed partial class Center : ContentVisual
1619
{
20+
/// <inheritdoc />
1721
protected override SizeHints MeasureCore(in LayoutConstraints constraints)
1822
{
1923
var content = Content;
@@ -25,6 +29,7 @@ protected override SizeHints MeasureCore(in LayoutConstraints constraints)
2529
return content.Measure(constraints);
2630
}
2731

32+
/// <inheritdoc />
2833
protected override void ArrangeCore(in Rectangle finalRect)
2934
{
3035
Bounds = finalRect;

src/XenoAtom.Terminal.UI/Controls/Collapsible.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public sealed partial class Collapsible : Visual
3939
private Rectangle _headerRect;
4040
private Rectangle _contentRect;
4141

42+
/// <summary>
43+
/// Initializes a new instance of the <see cref="Collapsible"/> class.
44+
/// </summary>
4245
public Collapsible()
4346
{
4447
Focusable = true;

src/XenoAtom.Terminal.UI/Controls/CommandPalette.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public sealed class CommandPalette : Visual
2222
private readonly List<CommandPaletteItem> _visibleItems;
2323
private int _resultsHeight = 8;
2424

25+
/// <summary>
26+
/// Initializes a new instance of the <see cref="CommandPalette"/> class.
27+
/// </summary>
2528
public CommandPalette()
2629
{
2730
Focusable = false;
@@ -59,8 +62,14 @@ public CommandPalette()
5962
_results.Update(_ => RebuildResults());
6063
}
6164

65+
/// <summary>
66+
/// Gets the collection of command palette items.
67+
/// </summary>
6268
public BindableList<CommandPaletteItem> Items { get; }
6369

70+
/// <summary>
71+
/// Gets or sets the number of visible result rows.
72+
/// </summary>
6473
public int ResultsHeight
6574
{
6675
get => _resultsHeight;
@@ -72,6 +81,9 @@ public int ResultsHeight
7281
}
7382
}
7483

84+
/// <summary>
85+
/// Shows the command palette in a popup.
86+
/// </summary>
7587
public void Show()
7688
{
7789
VerifyAccess();
@@ -91,17 +103,24 @@ public void Show()
91103
_hostPopup.Show();
92104
}
93105

106+
/// <summary>
107+
/// Closes the command palette popup if it is open.
108+
/// </summary>
94109
public void Close() => _hostPopup?.Close();
95110

111+
/// <inheritdoc />
96112
protected override int ChildrenCount => 1;
97113

114+
/// <inheritdoc />
98115
protected override Visual GetChild(int index) => index == 0 ? _frame : throw new ArgumentOutOfRangeException(nameof(index));
99116

117+
/// <inheritdoc />
100118
protected override SizeHints MeasureCore(in LayoutConstraints constraints)
101119
{
102120
return _frame.Measure(constraints);
103121
}
104122

123+
/// <inheritdoc />
105124
protected override void ArrangeCore(in Rectangle finalRect)
106125
{
107126
_frame.Arrange(finalRect);

src/XenoAtom.Terminal.UI/Controls/ComputedVisual.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@
1212

1313
namespace XenoAtom.Terminal.UI.Controls;
1414

15+
/// <summary>
16+
/// Represents a visual whose content is produced by a dynamic builder function.
17+
/// </summary>
1518
public sealed partial class ComputedVisual : Visual
1619
{
20+
/// <summary>
21+
/// Initializes a new instance of the <see cref="ComputedVisual"/> class.
22+
/// </summary>
23+
/// <param name="build">The function that builds the child visual.</param>
1724
public ComputedVisual(Func<Visual?> build)
1825
{
1926
this.Child(build);
@@ -23,9 +30,13 @@ public ComputedVisual(Func<Visual?> build)
2330
this.VerticalAlignment(() => _child?.VerticalAlignment ?? VerticalAlignment.Stretch);
2431
}
2532

33+
/// <summary>
34+
/// Gets or sets the computed child visual.
35+
/// </summary>
2636
[Bindable]
2737
public partial Visual? Child { get; set; }
2838

39+
/// <inheritdoc />
2940
protected override SizeHints MeasureCore(in LayoutConstraints constraints)
3041
{
3142
var child = Child;
@@ -37,6 +48,7 @@ protected override SizeHints MeasureCore(in LayoutConstraints constraints)
3748
return child.Measure(constraints);
3849
}
3950

51+
/// <inheritdoc />
4052
protected override void ArrangeCore(in Rectangle finalRect)
4153
{
4254
var child = Child;
@@ -50,8 +62,10 @@ protected override void ArrangeCore(in Rectangle finalRect)
5062
child.Arrange(finalRect);
5163
}
5264

65+
/// <inheritdoc />
5366
protected override int ChildrenCount => _child is null ? 0 : 1;
5467

68+
/// <inheritdoc />
5569
protected override Visual GetChild(int index)
5670
{
5771
if (index == 0 && _child is not null)

src/XenoAtom.Terminal.UI/Controls/ContentSwitcher.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,29 @@ public sealed partial class ContentSwitcher : Panel
1616
{
1717
private Visual? _active;
1818

19+
/// <summary>
20+
/// Initializes a new instance of the <see cref="ContentSwitcher"/> class.
21+
/// </summary>
1922
public ContentSwitcher()
2023
{
2124
this.SelectedIndex(0);
2225
}
2326

27+
/// <summary>
28+
/// Gets or sets the index of the active child.
29+
/// </summary>
2430
[Bindable]
2531
public partial int SelectedIndex { get; set; }
2632

33+
/// <inheritdoc />
2734
protected override int ChildrenCount
2835
=> TryGetActiveChild(out _) ? 1 : 0;
2936

37+
/// <inheritdoc />
3038
protected override Visual GetChild(int index)
3139
=> index == 0 && TryGetActiveChild(out var child) ? child : throw new ArgumentOutOfRangeException(nameof(index));
3240

41+
/// <inheritdoc />
3342
protected override SizeHints MeasureCore(in LayoutConstraints constraints)
3443
{
3544
if (!TryGetActiveChild(out var child))
@@ -40,6 +49,7 @@ protected override SizeHints MeasureCore(in LayoutConstraints constraints)
4049
return child.Measure(constraints);
4150
}
4251

52+
/// <inheritdoc />
4353
protected override void ArrangeCore(in Rectangle finalRect)
4454
{
4555
if (!TryGetActiveChild(out var child))

src/XenoAtom.Terminal.UI/Controls/ContentVisual.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,27 @@ namespace XenoAtom.Terminal.UI.Controls;
1212
/// </summary>
1313
public abstract partial class ContentVisual : Visual
1414
{
15+
/// <summary>
16+
/// Gets or sets the single content visual.
17+
/// </summary>
1518
[Bindable]
1619
public partial Visual? Content { get; set; }
1720

21+
/// <inheritdoc />
1822
protected override int ChildrenCount => _content is null ? 0 : 1;
1923

24+
/// <inheritdoc />
2025
protected override Visual GetChild(int index)
2126
=> index == 0 && _content is not null ? _content : throw new ArgumentOutOfRangeException(nameof(index));
2227

28+
/// <inheritdoc />
2329
protected override SizeHints MeasureCore(in LayoutConstraints constraints)
2430
{
2531
var content = Content;
2632
return content is null ? SizeHints.Fixed(Size.Zero) : content.Measure(constraints);
2733
}
2834

35+
/// <inheritdoc />
2936
protected override void ArrangeCore(in Rectangle finalRect)
3037
{
3138
Bounds = finalRect;

src/XenoAtom.Terminal.UI/Controls/DockLayout.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,39 @@
1212

1313
namespace XenoAtom.Terminal.UI.Controls;
1414

15+
/// <summary>
16+
/// Arranges top, bottom, and content regions in a vertical dock layout.
17+
/// </summary>
1518
public sealed partial class DockLayout : Visual
1619
{
20+
/// <summary>
21+
/// Initializes a new instance of the <see cref="DockLayout"/> class.
22+
/// </summary>
1723
public DockLayout()
1824
{
1925
HorizontalAlignment = HorizontalAlignment.Stretch;
2026
VerticalAlignment = VerticalAlignment.Stretch;
2127
}
2228

29+
/// <summary>
30+
/// Gets or sets the top region content.
31+
/// </summary>
2332
[Bindable]
2433
public partial Visual? Top { get; set; }
2534

35+
/// <summary>
36+
/// Gets or sets the bottom region content.
37+
/// </summary>
2638
[Bindable]
2739
public partial Visual? Bottom { get; set; }
2840

41+
/// <summary>
42+
/// Gets or sets the main content region.
43+
/// </summary>
2944
[Bindable]
3045
public partial Visual? Content { get; set; }
3146

47+
/// <inheritdoc />
3248
protected override SizeHints MeasureCore(in LayoutConstraints constraints)
3349
{
3450
var top = Top;
@@ -83,6 +99,7 @@ protected override SizeHints MeasureCore(in LayoutConstraints constraints)
8399
shrinkY: contentHints.FlexShrinkY).Normalize();
84100
}
85101

102+
/// <inheritdoc />
86103
protected override void ArrangeCore(in Rectangle finalRect)
87104
{
88105
Bounds = finalRect;
@@ -115,6 +132,7 @@ protected override void ArrangeCore(in Rectangle finalRect)
115132
}
116133
}
117134

135+
/// <inheritdoc />
118136
protected override int ChildrenCount
119137
{
120138
get
@@ -127,6 +145,7 @@ protected override int ChildrenCount
127145
}
128146
}
129147

148+
/// <inheritdoc />
130149
protected override Visual GetChild(int index)
131150
{
132151
if ((uint)index >= (uint)ChildrenCount)

src/XenoAtom.Terminal.UI/Controls/Footer.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,42 @@
1010

1111
namespace XenoAtom.Terminal.UI.Controls;
1212

13+
/// <summary>
14+
/// Represents a footer bar with left, center, and right slots.
15+
/// </summary>
1316
public sealed partial class Footer : Visual
1417
{
18+
/// <summary>
19+
/// Initializes a new instance of the <see cref="Footer"/> class.
20+
/// </summary>
1521
public Footer()
1622
{
1723
HorizontalAlignment = HorizontalAlignment.Stretch;
1824
}
1925

26+
/// <summary>
27+
/// Gets or sets the left-aligned content.
28+
/// </summary>
2029
[Bindable]
2130
public partial Visual? Left { get; set; }
2231

32+
/// <summary>
33+
/// Gets or sets the centered content.
34+
/// </summary>
2335
[Bindable]
2436
public partial Visual? Center { get; set; }
2537

38+
/// <summary>
39+
/// Gets or sets the right-aligned content.
40+
/// </summary>
2641
[Bindable]
2742
public partial Visual? Right { get; set; }
2843

44+
/// <inheritdoc />
2945
protected override int ChildrenCount
3046
=> (_left is null ? 0 : 1) + (_center is null ? 0 : 1) + (_right is null ? 0 : 1);
3147

48+
/// <inheritdoc />
3249
protected override Visual GetChild(int index)
3350
{
3451
if (_left is not null)
@@ -51,6 +68,7 @@ protected override Visual GetChild(int index)
5168
throw new ArgumentOutOfRangeException(nameof(index));
5269
}
5370

71+
/// <inheritdoc />
5472
protected override SizeHints MeasureCore(in LayoutConstraints constraints)
5573
{
5674
var labelConstraints = new LayoutConstraints(0, LayoutConstants.Infinite, 0, 1);
@@ -72,6 +90,7 @@ protected override SizeHints MeasureCore(in LayoutConstraints constraints)
7290
return SizeHints.FlexX(min: new Size(0, 1), natural: natural, growX: 1, shrinkX: 1);
7391
}
7492

93+
/// <inheritdoc />
7594
protected override void ArrangeCore(in Rectangle finalRect)
7695
{
7796
var left = _left;
@@ -101,6 +120,7 @@ protected override void ArrangeCore(in Rectangle finalRect)
101120
}
102121
}
103122

123+
/// <inheritdoc />
104124
protected override void RenderOverride(CellBuffer buffer)
105125
{
106126
var rect = Bounds;

0 commit comments

Comments
 (0)