ScoreGauge
ConsoleMonster.Widgets
A supplied score with a gauge and labelled components. It never computes a score or severity band.
Inheritance
- object
- ScoreGauge
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 12
- Extension method ScoreGauge.AddPart
- Extension method ScoreGauge.AddParts
- Extension method ScoreGauge.Maximum
- Extension method ScoreGauge.Role
- Extension method ScoreGauge.Value
- Extension method ScoreGauge.Width
- Method ScoreGaugeFluent.AddPart
- Method ScoreGaugeFluent.AddParts
- Method ScoreGaugeFluent.Maximum
- Method ScoreGaugeFluent.Role
- Method ScoreGaugeFluent.Value
- Method ScoreGaugeFluent.Width
Accepted by parameters 12
- Extension method ScoreGauge.AddPart
- Extension method ScoreGauge.AddParts
- Extension method ScoreGauge.Maximum
- Extension method ScoreGauge.Role
- Extension method ScoreGauge.Value
- Extension method ScoreGauge.Width
- Method ScoreGaugeFluent.AddPart
- Method ScoreGaugeFluent.AddParts
- Method ScoreGaugeFluent.Maximum
- Method ScoreGaugeFluent.Role
- Method ScoreGaugeFluent.Value
- Method ScoreGaugeFluent.Width
Constructors
public ScoreGauge(double value, double maximum = 100, ThemeToken role = Pass) #Creates a gauge using the caller's score and finding role.
Parameters
- value double
- maximum double = 100
- role ConsoleMonster.Styling.ThemeToken = Pass
Methods
public 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 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
public ThemeToken Role { get; set; } #The worst finding's role, supplied by the caller.
public int Width { get; set; } #A fixed gauge width, or zero for 24 cells at wide widths and 20 at narrow widths.
public IList<KeyValuePair<string, string>> Parts { get; } #Literal label/value components, in their supplied order.
Extension Methods
public static ScoreGauge AddPart(ScoreGauge scoreGauge, KeyValuePair<string, string> item) #Adds an item to ScoreGauge.Parts: Literal label/value components, in their supplied order.
Parameters
- scoreGauge ConsoleMonster.Widgets.ScoreGauge
- The instance.
- item System.Collections.Generic.KeyValuePair<string, string>
- The item.
public static ScoreGauge AddParts(ScoreGauge scoreGauge, params KeyValuePair<string, string>[] items) #Adds items to ScoreGauge.Parts: Literal label/value components, in their supplied order.
Parameters
- scoreGauge ConsoleMonster.Widgets.ScoreGauge
- The instance.
- items System.Collections.Generic.KeyValuePair<string, string>[]
- The items, in order.
public static ScoreGauge AddParts(ScoreGauge scoreGauge, IEnumerable<KeyValuePair<string, string>> items) #Adds items to ScoreGauge.Parts: Literal label/value components, in their supplied order.
Parameters
- scoreGauge ConsoleMonster.Widgets.ScoreGauge
- The instance.
- items System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>
- The items, in order.
public static ScoreGauge Maximum(ScoreGauge scoreGauge, double value) #Sets ScoreGauge.Maximum: The maximum score.
Parameters
- scoreGauge ConsoleMonster.Widgets.ScoreGauge
- The instance.
- value double
- The value.
Examples
// C# initializer or property // C# fluent
scoreGauge.Maximum = value; scoreGauge.Maximum(value);public static ScoreGauge Role(ScoreGauge scoreGauge, ThemeToken value) #Sets ScoreGauge.Role: The worst finding's role, supplied by the caller.
Parameters
- scoreGauge ConsoleMonster.Widgets.ScoreGauge
- The instance.
- value ConsoleMonster.Styling.ThemeToken
- The value.
Examples
// C# initializer or property // C# fluent
scoreGauge.Role = value; scoreGauge.Role(value);public static ScoreGauge Value(ScoreGauge scoreGauge, double value) #Sets ScoreGauge.Value: The engine's score.
Parameters
- scoreGauge ConsoleMonster.Widgets.ScoreGauge
- The instance.
- value double
- The value.
Examples
// C# initializer or property // C# fluent
scoreGauge.Value = value; scoreGauge.Value(value);public static ScoreGauge Width(ScoreGauge scoreGauge, int value) #Sets ScoreGauge.Width: A fixed gauge width, or zero for 24 cells at wide widths and 20 at narrow widths.
Parameters
- scoreGauge ConsoleMonster.Widgets.ScoreGauge
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
scoreGauge.Width = value; scoreGauge.Width(value);