BinaryExplorerBarPanelCollection
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 | |
|---|---|
Item | Gets the panel at a given position, counting from 0 at the top of the bar. |
| Methods | |
Add | Adds a panel at the bottom of the bar. |
AddRange | Adds several panels at the bottom of the bar, in the order given. |
Contains | Determines whether a panel is in the collection. |
IndexOf | Returns the position of a panel in the collection. |
Insert | Inserts a panel at a given position, moving the panels from that position down. |
OnClear | Raises ClearStarting and then PanelObjectsCollectionHasChanged. |
OnClearComplete | Raises ClearCompleted and then PanelObjectsCollectionHasChanged. |
OnInsert | Raises PanelObjectInserting and then PanelObjectsCollectionHasChanged. |
OnInsertComplete | Raises InsertCompleted and then PanelObjectsCollectionHasChanged. |
OnPanelObjectsCollectionHasChanged | Raises PanelObjectsCollectionHasChanged. |
OnRemove | Raises RemoveStarting and then PanelObjectsCollectionHasChanged. |
OnRemoveComplete | Raises PanelObjectRemoved and then PanelObjectsCollectionHasChanged. |
OnSet | Raises SetStarting and then PanelObjectsCollectionHasChanged. |
OnSetComplete | Raises SetCompleted and then PanelObjectsCollectionHasChanged. |
OnValidate | Raises Validate and then PanelObjectsCollectionHasChanged. |
Remove | Removes a panel from the bar. |
| Events | |
ClearCompleted | Occurs just after the collection has been cleared. |
ClearStarting | Occurs just before the collection is cleared. |
InsertCompleted | Occurs just after a panel has been inserted. |
PanelObjectInserting | Occurs just before a panel is inserted. The bar handles it to put the panel on itself. |
PanelObjectRemoved | Occurs just after a panel has been removed. The bar handles it to take the panel off itself. |
PanelObjectsCollectionHasChanged | Occurs at every step of every change to the collection – validation, insertion, removal, replacement and clearing, both before and after. |
RemoveStarting | Occurs just before a panel is removed. |
SetCompleted | Occurs just after the panel at a position has been replaced. |
SetStarting | Occurs just before the panel at a position is replaced. |
Validate | Occurs when a panel is about to be added, inserted or set; a handler can throw to refuse it. |
Properties
Item
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.IndexOutOfRangeExceptionindexis less than 0, or not less thanCount.
Methods
Add
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
Adds several panels at the bottom of the bar, in the order given.
Parameters
panelObjects- The panels to add.
Contains
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
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
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.ArgumentOutOfRangeExceptionindexis less than 0 or greater thanCount.
OnClear
Raises ClearStarting and then PanelObjectsCollectionHasChanged.
OnClearComplete
Raises ClearCompleted and then PanelObjectsCollectionHasChanged.
OnInsert
Raises PanelObjectInserting and then PanelObjectsCollectionHasChanged.
Parameters
index- The position the panel is being inserted at.
panelObject- The panel being inserted.
OnInsertComplete
Raises InsertCompleted and then PanelObjectsCollectionHasChanged.
Parameters
index- The position the panel was inserted at.
panelObject- The panel inserted.
OnPanelObjectsCollectionHasChanged
Raises PanelObjectsCollectionHasChanged.
Parameters
sender- The collection.
e- Not used; the event is raised with
EventArgs.Empty.
OnRemove
Raises RemoveStarting and then PanelObjectsCollectionHasChanged.
Parameters
index- The position the panel is being removed from.
panelObject- The panel being removed.
OnRemoveComplete
Raises PanelObjectRemoved and then PanelObjectsCollectionHasChanged.
Parameters
index- The position the panel was removed from.
panelObject- The panel removed.
OnSet
Raises SetStarting and then PanelObjectsCollectionHasChanged.
Parameters
index- The position being replaced.
prevObj- The panel at that position.
newObj- The panel replacing it.
OnSetComplete
Raises SetCompleted and then PanelObjectsCollectionHasChanged.
Parameters
index- The position replaced.
prevObj- The panel that was at that position.
newObj- The panel there now.
OnValidate
Raises Validate and then PanelObjectsCollectionHasChanged.
Parameters
validateObject- The panel being checked.
Remove
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
Occurs just after the collection has been cleared.
ClearStarting
Occurs just before the collection is cleared.
InsertCompleted
Occurs just after a panel has been inserted.
PanelObjectInserting
Occurs just before a panel is inserted. The bar handles it to put the panel on itself.
PanelObjectRemoved
Occurs just after a panel has been removed. The bar handles it to take the panel off itself.
PanelObjectsCollectionHasChanged
Occurs at every step of every change to the collection – validation, insertion, removal, replacement and clearing, both before and after.
RemoveStarting
Occurs just before a panel is removed.
SetCompleted
Occurs just after the panel at a position has been replaced.
SetStarting
Occurs just before the panel at a position is replaced.
Validate
Occurs when a panel is about to be added, inserted or set; a handler can throw to refuse it.