Skip to main content
Version: 4.2

MeterSegmentCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.2.0.0)

A mutable collection of segments that refreshes its owning meter when items change.

public class MeterSegmentCollection : Collection<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​

Instance member MeterSegmentCollection()​

Initializes a new instance of MeterSegmentCollection.

Methods​

Protected member ClearItems()​

Removes all items and their change subscriptions.

Protected member InsertItem(index, item)​

Inserts an item and starts observing its property changes.

ParameterTypeDescription
indexInt32Zero-based insertion position.
itemMeterSegmentNon-null item not already in this collection.

Protected member RemoveItem(index)​

Removes an item and stops observing it.

ParameterTypeDescription
indexInt32Zero-based position to remove.

Protected member SetItem(index, item)​

Replaces an item and transfers property-change observation.

ParameterTypeDescription
indexInt32Zero-based position to replace.
itemMeterSegmentNon-null replacement item.