TreeStructures 1.7.4
dotnet add package TreeStructures --version 1.7.4
NuGet\Install-Package TreeStructures -Version 1.7.4
<PackageReference Include="TreeStructures" Version="1.7.4" />
paket add TreeStructures --version 1.7.4
#r "nuget: TreeStructures, 1.7.4"
// Install TreeStructures as a Cake Addin #addin nuget:?package=TreeStructures&version=1.7.4 // Install TreeStructures as a Cake Tool #tool nuget:?package=TreeStructures&version=1.7.4
Introduction
This is a C# library designed for effectively handling tree structures.
Emphasizing flexibility and extensibility, the library allows easy manipulation of various tree structures.
Features:
- Rich extension methods for
ITreeNode<TNode>
- Achieving mutual references between parent and child nodes
- Classes forming a tree structure and their Generality
- Bidirectional Conversion between Different Data Structures and Tree Structures.
These are the four main features of the library.
Usage
To be documented in the wiki.
Concept
This library does not aim to be standalone.
Various useful libraries are already available, so we aim to handle tree structure-related functions while coexisting with other libraries.
Let's elaborate on the four features mentioned at the beginning.
Rich Extension Methods
Over 60 extension methods for ITreeNode<TNode>
are defined, including various overloads.
Examples include:
Enumeration: Preorder
, Levelorder
, all traversal methods, Leafs
, Ancestors
, DiscendArrivals
, DescendTraces
, etc.
Navigation: Root
, NextSibling
, LastSibling
, etc.
Editing: Including TryAddChild
, Try●●Child, Disassemble
, RemoveAllDescendant
, etc.
Parameter Retrieval: NodeIndex
, NodePath
, Height
, Depth
, etc.
Predicate Methods: IsDescendantOf
, IsAncestorOf
, IsRoot
, etc.
Conversion: ToNodeMap
, ToSerializableNodeMap
, ToTreeDiagram
, AsValuedTreeNode
Assembly Methods: Convert
, AssembleTree
, AssembleAsNAryTree
Mutual References Between Parent and Child Nodes
Mutual references between parent and child nodes are handled by base classes (TreeNodeBase<TNode>
or HierarchyWrapper<TSrc,TWrpr>
).
In the derived types of TreeNodeBase<TNode>
, customization can be achieved through protected virtual methods such as RemoveChildProcess
and InsertChildProcess
, which are defined as ●●ChildProcess
methods.
Classes Forming a Tree Structure and Their Generality
If you want to customize in detail, use TreeNodeBase<TNode>
.
For a GeneralTree, if you want to use it as a data structure or container for data, use GeneralTreeNode<TNode>
or ObservableTreeNode<TNode>
.
If you want to use an N-Ary Tree with a fixed number of branches and empty nodes set to null, use NAryTreeNode<TNode>
.
If you want to use it as a wrapper for objects or tree structure that forms the hierarchy, use (Hierarchy | TreeNode) Wrapper<TSrc,TWrpr>
.
If you need to handle resource disposal and observation, along with its role as a wrapper (e.g., ViewModel in MVVM), inherit and use Bindable(Hierarchy | TreeNode)Wrapper<TSrc,TWrpr>
.
In TreeNodeBase<TNode>
and its derived types, you can customize the collections used internally and those exposed externally by overriding the Setup(Inner | Public)ChildCollection
methods.
HierarchyWrapper<TSrc,TWrpr>
and its derived types allow customization only of the collection exposed externally.
Bidirectional Conversion between Different Data Structures and Tree Structures.
Support is provided for exte ITreeNode<TNode>
methods to objects that do not implement ITreeNode<TNode>
.
This is achieved by wrapping objects in a HierarchyWrapper<TSrc,TWrpr>
or BindableHierarchyWrapper<TSrc,TWrpr>
, or by calling AsValuedTreeNode
to provide the extension methods of ITreeNode<TNode>
.
Furthermore, various methods for mutual conversion, such as Convert
, AssembleTree
, and ToNodeMap
, are available through extension methods.
Namespaces Classification
TreeStructures;
Abstract classes define generic tree nodes, peripheral objects, and event arguments.
Inheritance diagram of generic tree nodes
Inheritance diagram of NodePath and NodeIndex (peripheral objects)
TreeStructures.Linq;
Extension methods for ITreeNode<TNode>
, IMutableTreeNode<TNode>
, IEnumerable<T>
TreeStructures.Utility;
Definition of ResultWithValue<T>
used as a return value for Try●● methods
TreeStructures.Collections;
It defines collections used in internal implementations or processing steps of extension methods.
These include the synchronizable ImitableCollection<TSrc,TConv>
,
the combinable observable collection CombinableObservableCollection<T>
,
and the ReadOnlySortFilterObservableCollection<T>
that applies sorting and filtering while synchronizing with an observable collection.
TreeStructures.EventManagement;
Objects used in event handling, implementing Observable tree nodes
TreeStructures.Xml.Serialization;
Dictionary and others used in serialization and deserialization
TreeStrucutures.Tree;
Purpose-specific trees
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.HashCode (>= 1.1.1)
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.7.4 | 146 | 1/31/2024 |
1.7.3 | 103 | 1/31/2024 |
1.7.2 | 103 | 1/31/2024 |
1.7.1 | 104 | 1/31/2024 |
1.7.0 | 84 | 1/30/2024 |
1.6.3 | 107 | 1/21/2024 |
1.6.2 | 101 | 1/21/2024 |
1.6.1 | 106 | 1/21/2024 |
1.6.0 | 101 | 1/21/2024 |
1.5.0 | 105 | 1/18/2024 |
1.4.6 | 118 | 1/14/2024 |
1.4.5 | 107 | 1/14/2024 |
1.4.4 | 101 | 1/10/2024 |
1.4.3 | 99 | 1/10/2024 |
1.4.1 | 103 | 1/8/2024 |
1.4.0 | 95 | 1/6/2024 |
1.3.1 | 84 | 1/3/2024 |
1.3.0 | 110 | 1/2/2024 |
1.2.0 | 150 | 12/30/2023 |
1.1.1 | 109 | 12/26/2023 |
1.1.0 | 127 | 12/21/2023 |
1.0.1 | 128 | 12/16/2023 |
1.0.0 | 129 | 12/14/2023 |