Class FilteredTreeView<T>
Displays a list of INameds objects in a TreeView with incremental search. An automatic hierarchy is generated based on a Separator character.
Namespace: NanoByte.Common.Controls
Assembly: NanoByte.Common.WinForms.dll
Syntax
public sealed class FilteredTreeView<T> : UserControl where T : INamed
Type Parameters
Name | Description |
---|---|
T | The type of INamed object to list. Special support for types implementing IHighlightColor and/or IContextMenu. |
Constructors
FilteredTreeView()
Declaration
public FilteredTreeView()
Properties
CheckBoxes
Controls whether check boxes are displayed for every entry.
Declaration
public bool CheckBoxes { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
CheckedEntries
Returns a list of all INamed objects currently marked with a check box.
Declaration
public ICollection<T> CheckedEntries { get; }
Property Value
Type | Description |
---|---|
ICollection<T> |
Remarks
Does NOT create a defensive copy. Take care to only add valid elements when modifying. Call UpdateList(Object) after changing.
Nodes
The INamed (and optionally IContextMenu) objects to be listed in the tree.
Declaration
public NamedCollection<T> Nodes { get; set; }
Property Value
Type | Description |
---|---|
NamedCollection<T> |
SelectedEntry
Declaration
public T SelectedEntry { get; set; }
Property Value
Type | Description |
---|---|
T |
Separator
The character used to split Names into tree levels.
Declaration
public char Separator { get; set; }
Property Value
Type | Description |
---|---|
System.Char |
ShowSearchBox
Toggle the visibility of the search box.
Declaration
public bool ShowSearchBox { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Dispose(Boolean)
Clean up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | true if managed resources should be disposed; otherwise, false. |
UpdateList(Object)
Declaration
public void UpdateList(object sender = null)
Parameters
Type | Name | Description |
---|---|---|
Object | sender |
Remarks
Called automatically internally.
Events
CheckedEntriesChanged
Occurs whenever the content of CheckedEntries has changed.
Declaration
public event EventHandler CheckedEntriesChanged
Event Type
Type | Description |
---|---|
EventHandler |
SelectedEntryChanged
Occurs whenever SelectedEntry has been changed.
Declaration
public event EventHandler SelectedEntryChanged
Event Type
Type | Description |
---|---|
EventHandler |
SelectionConfirmed
Occurs when the user has confirmed the SelectedEntry via double-clicking or pressing Enter.
Declaration
public event EventHandler SelectionConfirmed
Event Type
Type | Description |
---|---|
EventHandler |