Show / Hide Table of Contents

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.

Inheritance
Object
FilteredTreeView<T>
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

The INamed object currently selected in the TreeView; null for no selection.

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
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)

Updates the filtered TreeView representation of Nodes.

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

Extension Methods

UpdateUtils.To<TIn, TOut>(TIn, Func<TIn, TOut>)
JsonStorage.SaveJson<T>(T, Stream)
JsonStorage.SaveJson<T>(T, String)
JsonStorage.ToJsonString<T>(T)
JsonStorage.ReparseAsJson<T>(Object)
JsonStorage.ReparseAsJson<T>(Object, T)
XmlStorage.SaveXml(Object, Stream, String)
XmlStorage.SaveXml<T>(T, String, String)
XmlStorage.ToXmlString(Object, String)
ConversionUtils.ConvertToString<TType>(TType)
In This Article
Back to top Copyright Bastian Eicher