ViewHeader
ConsoleMonster.Widgets
A title and facts joined by a thin leader to a right-aligned state.
Inheritance
- object
- ViewHeader
Usage
Explore 24 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 11
- Property ConsoleViewFrame.Header
- Extension method ViewHeader.AddFact
- Extension method ViewHeader.AddFacts
- Extension method ViewHeader.State
- Extension method ViewHeader.Streaming
- Extension method ViewHeader.Title
- Method ViewHeaderFluent.AddFact
- Method ViewHeaderFluent.AddFacts
- Method ViewHeaderFluent.State
- Method ViewHeaderFluent.Streaming
- Method ViewHeaderFluent.Title
Accepted by parameters 13
- Constructor ConsoleViewFrame.ConsoleViewFrame
- Extension method ConsoleViewFrame.Header
- Method ConsoleViewFrameFluent.Header
- Extension method ViewHeader.AddFact
- Extension method ViewHeader.AddFacts
- Extension method ViewHeader.State
- Extension method ViewHeader.Streaming
- Extension method ViewHeader.Title
- Method ViewHeaderFluent.AddFact
- Method ViewHeaderFluent.AddFacts
- Method ViewHeaderFluent.State
- Method ViewHeaderFluent.Streaming
- Method ViewHeaderFluent.Title
Constructors
public ViewHeader(string title, string? state = null, params string[] facts) #Creates a header. The title is literal text; facts and state accept markup.
Parameters
- title string
- state string? = null
- facts string[]
Methods
public int CompactWidth(int available, RenderContext context) #Natural compact width when the full title/facts/state line cannot fit.
Parameters
- available int
- context ConsoleMonster.Canvas.RenderContext
Returns
intpublic Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public int NaturalWidth(RenderContext context) #The natural width before applying the compact title layout.
Parameters
- context ConsoleMonster.Canvas.RenderContext
Returns
intpublic void Render(Region region, RenderContext context) #Renders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Inherited Methods
Properties
Extension Methods
public static ViewHeader AddFact(ViewHeader viewHeader, string item) #Adds an item to ViewHeader.Facts: Fact markup, joined only at separators.
Parameters
- viewHeader ConsoleMonster.Widgets.ViewHeader
- The instance.
- item string
- The item.
public static ViewHeader AddFacts(ViewHeader viewHeader, params string[] items) #Adds items to ViewHeader.Facts: Fact markup, joined only at separators.
Parameters
- viewHeader ConsoleMonster.Widgets.ViewHeader
- The instance.
- items string[]
- The items, in order.
public static ViewHeader AddFacts(ViewHeader viewHeader, IEnumerable<string> items) #Adds items to ViewHeader.Facts: Fact markup, joined only at separators.
Parameters
- viewHeader ConsoleMonster.Widgets.ViewHeader
- The instance.
- items System.Collections.Generic.IEnumerable<string>
- The items, in order.
public static ViewHeader State(ViewHeader viewHeader, string value) #Sets ViewHeader.State: State markup, including an optional observation time.
Parameters
- viewHeader ConsoleMonster.Widgets.ViewHeader
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
viewHeader.State = value; viewHeader.State(value);public static ViewHeader Streaming(ViewHeader viewHeader, bool value) #Sets ViewHeader.Streaming: Whether the header describes an open stream, whose verdict is not known yet.
Parameters
- viewHeader ConsoleMonster.Widgets.ViewHeader
- The instance.
- value bool
- The value.
Examples
// C# initializer or property // C# fluent
viewHeader.Streaming = value; viewHeader.Streaming(value);public static ViewHeader Streaming(ViewHeader viewHeader) #Sets ViewHeader.Streaming to true.
Parameters
- viewHeader ConsoleMonster.Widgets.ViewHeader
- The instance to configure.
public static ViewHeader Title(ViewHeader viewHeader, string value) #Sets ViewHeader.Title: The literal title.
Parameters
- viewHeader ConsoleMonster.Widgets.ViewHeader
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
viewHeader.Title = value; viewHeader.Title(value);