Northwoods.GoWPF 2.2.4 Assembly
IConnectedModel Interface
Members 

A model that supports directed link relationships between nodes, with the relationship information stored on each node as collections of connected nodes.
Syntax
Public Interface IConnectedModel 
   Inherits IDiagramModel 
public interface IConnectedModel : IDiagramModel  
Remarks

Each node data has two collections of references to other nodes: one that lists the nodes from which there are links connecting to this node, and one that lists the nodes to which there are links connecting from this node. All node references are by node data key value.

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.

Although this model supports links between any pair of nodes in either or both directions, and supports reflexive links from a node to itself, it does not support more than one link between any pair of nodes in the same direction. 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 collection of "from" node keys: DoFromNodeKeyAdded, DoFromNodeKeyRemoved, DoFromNodeKeysChanged. These methods also include changes to the collection of "to" node keys: DoToNodeKeyAdded, DoToNodeKeyRemoved, DoToNodeKeysChanged.

The navigation methods support examining and traversing the graph. These methods are actually defined in the base interface, IDiagramModel. IDiagramModel.FindNodeByKey, IDiagramModel.IsLinked, IDiagramModel.GetFromNodesForNode, IDiagramModel.GetToNodesForNode, IDiagramModel.GetConnectedNodesForNode, and IDiagramModel.IsLinkValid.

The modification methods are used to alter the graph. A number of these methods are defined in IDiagramModel, such as IDiagramModel.AddNode, IDiagramModel.RemoveNode, IDiagramModel.AddLink, IDiagramModel.RemoveLink, and IDiagramModel.AddCollectionCopy. But this interface adds several methods. For the collection of "from" node keys: AddFromNodeKey, RemoveFromNodeKey, SetFromNodeKeys. For the collection of "to" node keys: AddToNodeKey, RemoveToNodeKey, SetToNodeKeys.

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

IConnectedModel Members
Northwoods.GoXam.Model Namespace
GraphModel<NodeType,NodeKey> Class

 

 


© Northwoods Software 2017. All Rights Reserved.

Send Feedback