CommandCollection
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Owns ordered commands and observes their property changes.
- C#
- VB.NET
public class CommandCollection : Collection<PaletteCommand>
Public Class CommandCollection
Inherits Collection(Of PaletteCommand)
A command belongs to one collection. Removing it releases ownership.
Example:
palette.Commands.Add(new PaletteCommand { Text = "Account" });
palette.Commands.Add(new PaletteCommand { Text = "Review" });
palette.Show();
Constructors
CommandCollection()
Initializes a new instance of CommandCollection.
Methods
ClearItems()
Releases all commands and clears the collection.
InsertItem(index, item)
Inserts and observes a command.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | Insertion index. |
| item | PaletteCommand | An unowned command. |
RemoveItem(index)
Removes a command and releases ownership.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | Removal index. |
SetItem(index, item)
Replaces a command and transfers observation.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | Replacement index. |
| item | PaletteCommand | An unowned command. |