Skybound Rebar

Rebar.RebarBandCollection Class

Represents a collection that contains the bands in a rebar control.

For a list of all members of this type, see Rebar.RebarBandCollection Members.

System.Object
   System.Collections.CollectionBase
      Skybound.Rebar.Rebar.RebarBandCollection

[Visual Basic]
NotInheritable Public Class Rebar.RebarBandCollection
    Inherits CollectionBase
[C#]
public sealed class Rebar.RebarBandCollection : CollectionBase

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

This class represents the collection RebarBand objects stored in a Rebar. This collection is stable, meaning that the order of the items in the collection will not change if the physical band order is changed by the user.

The Add and Remove methods enable you to add and remove individual bands from the collection. You can also use the Clear method to remove all the bands from the collection.

Example

This example removes an existing RebarBand from a Rebar control if it exists and adds and inserts three new RebarBand object to the Rebar.

private void UpdateRebarBands(Skybound.Rebar.Rebar rebar, Skybound.Rebar.RebarBand toRemove)
{
    // if toRemove is in in the collection, remove it:
    if(rebar.Bands.Contains(toRemove))
    {
        rebar.Bands.Remove(toRemove);
    }
    
    // create three new rebar bands:
    RebarBand bandMenu = new RebarBand(RebarBandType.MenuBar);
    RebarBand bandTools = new RebarBand(RebarBandType.ToolBar);
    RebarBand bandAddress = new RebarBand(RebarBandType.ToolBar, "Address", null);
    
    // add the first two bands to the rebar:
    rebar.Bands.Add(bandMenu);
    rebar.Bands.Add(bandTools);
    
    // insert the third band before the first.  Note that although the index of this band
    // in the collection will be zero, it will still be physically ordered after the previous
    // two bands on the screen
    rebar.Bands.Insert(0, bandAddress);
}
            

Requirements

Namespace: Skybound.Rebar

Assembly: Skybound.Rebar (in Skybound.Rebar.dll)

See Also

Rebar.RebarBandCollection Members | Skybound.Rebar Namespace