MeterSegmentCollection
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
A mutable collection of segments that refreshes its owning meter when items change.
- C#
- VB.NET
public class MeterSegmentCollection : Collection<MeterSegment>
Public Class MeterSegmentCollection
Inherits Collection(Of MeterSegment)
Null items and duplicate item instances are rejected. Item property changes are observed automatically.
Example:
var meter = new MeterBar { Maximum = 100, Value = 60 };
meter.Segments.Add(new MeterSegment("Used", 60, MeterTone.Primary));
meter.Segments[0].Tone = MeterTone.Warning; // Refreshes the owning meter.
Constructors
MeterSegmentCollection()
Initializes a new instance of MeterSegmentCollection.
Methods
ClearItems()
Removes all items and their change subscriptions.
InsertItem(index, item)
Inserts an item and starts observing its property changes.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | Zero-based insertion position. |
| item | MeterSegment | Non-null item not already in this collection. |
RemoveItem(index)
Removes an item and stops observing it.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | Zero-based position to remove. |
SetItem(index, item)
Replaces an item and transfers property-change observation.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | Zero-based position to replace. |
| item | MeterSegment | Non-null replacement item. |