Northwoods.GoWPF 2.2.4 Assembly
ITreeModel Interface
Members 

This kind of diagram model only supports tree-structured relationships.
Syntax
Public Interface ITreeModel 
   Inherits IDiagramModel 
public interface ITreeModel : IDiagramModel  
Remarks

Each node data may have a reference to a "parent" node. Each node data may have a collection of references to "children" nodes. All references are by key values.

This kind of model assumes the links are implicit from the references in the lists. If you want to use separate data structures to explicitly represent link information, use the ILinksModel.

This model does not support links that would form a cycle, including reflexive links. Nor does it support more than one link between any pair of nodes. If you need to model multiple links between nodes, use the ILinksModel.

There are three categories of methods: updating, navigation, and modification.

The updating methods need to be called when there has been a change to the data, so that the model can be kept up-to-date. These methods include changes to the "parent" node key: DoParentNodeChanged. These methods also include changes to the collection of "children" node keys: DoChildNodeKeyAdded, DoChildNodeKeyRemoved, DoChildNodeKeysChanged.

The navigation methods support examining and traversing the graph. Some of these methods are actually defined in the base interface, IDiagramModel. FindNodeByKey, IsLinked, GetConnectedNodesForNode, and IsLinkValid. But this interface adds a few more methods: GetParentForNode and GetChildrenForNode.

The modification methods are used to alter the graph. A number of these methods are defined in IDiagramModel, such as AddNode, RemoveNode, AddLink, RemoveLink, and AddCollectionCopy. But this interface adds several methods. For the "parent" node keys: SetParentNodeKey. For the collection of "children" node keys: AddChildNodeKey, RemoveChildNodeKey, SetChildNodeKeys.

Note that this interface is universal, because it can only assume the node data is of type System.Object. The corresponding methods in the generic model classes operate on and return a specific node data type.

Requirements
See Also

Reference

ITreeModel Members
Northwoods.GoXam.Model Namespace
TreeModel<NodeType,NodeKey> Class

 

 


© Northwoods Software 2017. All Rights Reserved.

Send Feedback