HypernovaDesktop Components · docs
Binarymission
WinForms › Explorer Bar › BinaryExplorerBarPanelCollection

BinaryExplorerBarPanelCollection

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.NavigationControls

The ordered list of BinaryExplorerBarPanel objects a BinaryExplorerBar shows, from top to bottom.

public class BinaryExplorerBarPanelCollection : CollectionBase

Inherits from / implements: CollectionBase

Remarks

Reach it through BinaryExplorerBar.Panels. Adding a panel puts it on the bar and removing one – or calling Clear – takes it off; the bar lays itself out again after every change.

Examples

// Remove the groups that only apply to a selected file.
for (int i = explorerBar.Panels.Count - 1; i >= 0; i--)
{
    BinaryExplorerBarPanel panel = explorerBar.Panels[i];
    if (panel.Tag as string == "file-only")
        explorerBar.Panels.Remove(panel);
}

Members at a glance

Properties
ItemGets the panel at a given position, counting from 0 at the top of the bar.
Methods
AddAdds a panel at the bottom of the bar.
AddRangeAdds several panels at the bottom of the bar, in the order given.
ContainsDetermines whether a panel is in the collection.
IndexOfReturns the position of a panel in the collection.
InsertInserts a panel at a given position, moving the panels from that position down.
OnClearRaises ClearStarting and then PanelObjectsCollectionHasChanged.
OnClearCompleteRaises ClearCompleted and then PanelObjectsCollectionHasChanged.
OnInsertRaises PanelObjectInserting and then PanelObjectsCollectionHasChanged.
OnInsertCompleteRaises InsertCompleted and then PanelObjectsCollectionHasChanged.
OnPanelObjectsCollectionHasChangedRaises PanelObjectsCollectionHasChanged.
OnRemoveRaises RemoveStarting and then PanelObjectsCollectionHasChanged.
OnRemoveCompleteRaises PanelObjectRemoved and then PanelObjectsCollectionHasChanged.
OnSetRaises SetStarting and then PanelObjectsCollectionHasChanged.
OnSetCompleteRaises SetCompleted and then PanelObjectsCollectionHasChanged.
OnValidateRaises Validate and then PanelObjectsCollectionHasChanged.
RemoveRemoves a panel from the bar.
Events
ClearCompletedOccurs just after the collection has been cleared.
ClearStartingOccurs just before the collection is cleared.
InsertCompletedOccurs just after a panel has been inserted.
PanelObjectInsertingOccurs just before a panel is inserted. The bar handles it to put the panel on itself.
PanelObjectRemovedOccurs just after a panel has been removed. The bar handles it to take the panel off itself.
PanelObjectsCollectionHasChangedOccurs at every step of every change to the collection – validation, insertion, removal, replacement and clearing, both before and after.
RemoveStartingOccurs just before a panel is removed.
SetCompletedOccurs just after the panel at a position has been replaced.
SetStartingOccurs just before the panel at a position is replaced.
ValidateOccurs when a panel is about to be added, inserted or set; a handler can throw to refuse it.

Properties

Item

public BinaryExplorerBarPanel this[int index]

Gets the panel at a given position, counting from 0 at the top of the bar.

Parameters
index
The zero-based position of the panel.
Returns

The panel at that position.

Exceptions
System.IndexOutOfRangeException
index is less than 0, or not less than Count.

Methods

Add

public int Add(BinaryExplorerBarPanel panelObject)

Adds a panel at the bottom of the bar.

Parameters
panelObject
The panel to add.
Returns

The panel's index in the collection.

Remarks

A panel arrives in the state its BinaryExplorerBarPanel.CurrentExplorerBarPanelState gives, at its BinaryExplorerBarPanel.CurrentHeight when expanded.

AddRange

public void AddRange(BinaryExplorerBarPanel[] panelObjects)

Adds several panels at the bottom of the bar, in the order given.

Parameters
panelObjects
The panels to add.

Contains

public bool Contains(BinaryExplorerBarPanel panelObject)

Determines whether a panel is in the collection.

Parameters
panelObject
The panel to look for.
Returns

true if the panel is in the collection; otherwise false.

IndexOf

public int IndexOf(BinaryExplorerBarPanel panelObject)

Returns the position of a panel in the collection.

Parameters
panelObject
The panel to look for.
Returns

The zero-based position of the panel, or -1 when it is not in the collection.

Insert

public void Insert(int index, BinaryExplorerBarPanel panelObject)

Inserts a panel at a given position, moving the panels from that position down.

Parameters
index
The zero-based position, from 0 (the top) to Count (the bottom).
panelObject
The panel to insert.
Exceptions
System.ArgumentOutOfRangeException
index is less than 0 or greater than Count.

OnClear

protected override void OnClear()

OnClearComplete

protected override void OnClearComplete()

OnInsert

protected override void OnInsert(int index, object panelObject)
Parameters
index
The position the panel is being inserted at.
panelObject
The panel being inserted.

OnInsertComplete

protected override void OnInsertComplete(int index, object panelObject)
Parameters
index
The position the panel was inserted at.
panelObject
The panel inserted.

OnPanelObjectsCollectionHasChanged

protected virtual void OnPanelObjectsCollectionHasChanged(object sender, EventArgs e)
Parameters
sender
The collection.
e
Not used; the event is raised with EventArgs.Empty.

OnRemove

protected override void OnRemove(int index, object panelObject)
Parameters
index
The position the panel is being removed from.
panelObject
The panel being removed.

OnRemoveComplete

protected override void OnRemoveComplete(int index, object panelObject)
Parameters
index
The position the panel was removed from.
panelObject
The panel removed.

OnSet

protected override void OnSet(int index, object prevObj, object newObj)
Parameters
index
The position being replaced.
prevObj
The panel at that position.
newObj
The panel replacing it.

OnSetComplete

protected override void OnSetComplete(int index, object prevObj, object newObj)
Parameters
index
The position replaced.
prevObj
The panel that was at that position.
newObj
The panel there now.

OnValidate

protected override void OnValidate(object validateObject)
Parameters
validateObject
The panel being checked.

Remove

public void Remove(BinaryExplorerBarPanel panelObject)

Removes a panel from the bar.

Parameters
panelObject
The panel to remove. A panel that is not in the collection is ignored.
Remarks

The panel is taken off the bar but not disposed, so it can be added again later.

Events

ClearCompleted

public event BinaryExplorerBarPanelCollectionClearedEventHandler ClearCompleted

Occurs just after the collection has been cleared.

ClearStarting

public event BinaryExplorerBarPanelCollectionClearedEventHandler ClearStarting

Occurs just before the collection is cleared.

InsertCompleted

public event BinaryExplorerBarPanelCollectionChangedEventHandler InsertCompleted

Occurs just after a panel has been inserted.

PanelObjectInserting

public event BinaryExplorerBarPanelCollectionChangedEventHandler PanelObjectInserting

Occurs just before a panel is inserted. The bar handles it to put the panel on itself.

PanelObjectRemoved

public event BinaryExplorerBarPanelCollectionChangedEventHandler PanelObjectRemoved

Occurs just after a panel has been removed. The bar handles it to take the panel off itself.

PanelObjectsCollectionHasChanged

public event EventHandler PanelObjectsCollectionHasChanged

Occurs at every step of every change to the collection – validation, insertion, removal, replacement and clearing, both before and after.

RemoveStarting

public event BinaryExplorerBarPanelCollectionChangedEventHandler RemoveStarting

Occurs just before a panel is removed.

SetCompleted

public event BinaryExplorerBarPanelCollectionSetEventHandler SetCompleted

Occurs just after the panel at a position has been replaced.

SetStarting

public event BinaryExplorerBarPanelCollectionSetEventHandler SetStarting

Occurs just before the panel at a position is replaced.

Validate

public event BinaryExplorerBarPanelCollectionValidationEventHandler Validate

Occurs when a panel is about to be added, inserted or set; a handler can throw to refuse it.