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.
[Guid("5065F310-D0B3-4AD3-BBE5-B41D00D5F036")]
public sealed class FilteredTreeView<T> : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl where T : notnull, INamed
Type Parameters
TThe type of INamed object to list. Special support for types implementing IHighlightColor and/or IContextMenu.
- Inheritance
-
objectMarshalByRefObjectFilteredTreeView<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
FilteredTreeView()
public FilteredTreeView()
Properties
CheckBoxes
Controls whether check boxes are displayed for every entry.
public bool CheckBoxes { get; set; }
Property Value
CheckedEntries
Returns a list of all INamed objects currently marked with a check box.
public ICollection<T> CheckedEntries { get; }
Property Value
- 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.
[Browsable(false)]
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "This control is supposed to represent a live and mutable collection")]
public NamedCollection<T>? Nodes { get; set; }
Property Value
SelectedEntry
[Browsable(false)]
public T? SelectedEntry { get; set; }
Property Value
- T
Separator
The character used to split Names into tree levels.
public char Separator { get; set; }
Property Value
ShowSearchBox
Toggle the visibility of the search box.
public bool ShowSearchBox { get; set; }
Property Value
Methods
Dispose(bool)
Clean up any resources being used.
protected override void Dispose(bool disposing)
Parameters
disposingbooltrue if managed resources should be disposed; otherwise, false.
UpdateList(object?)
public void UpdateList(object? sender = null)
Parameters
senderobject
Remarks
Called automatically internally.
Events
CheckedEntriesChanged
Occurs whenever the content of CheckedEntries has changed.
public event EventHandler? CheckedEntriesChanged
Event Type
SelectedEntryChanged
Occurs whenever SelectedEntry has been changed.
public event EventHandler? SelectedEntryChanged
Event Type
SelectionConfirmed
Occurs when the user has confirmed the SelectedEntry via double-clicking or pressing Enter.
public event EventHandler? SelectionConfirmed