GraphLinksModel

StockSharp.Xaml.Diagram.GXDiagram.Model

The generic implementation of a diagram model consisting of nodes and subgraphs, with any number of explicit link data representing links between any two nodes.

Inherits: DiagramModel

Implements: ILinksModel, IDiagramModel, ISubGraphLinksModel, ISubGraphModel, IGroupsModel

Constructors

GraphLinksModel
public GraphLinksModel()
graphLinksModel = GraphLinksModel()

The default constructor produces an empty model.

Properties

GroupNodePath
public string GroupNodePath { get; set; }
value = graphLinksModel.GroupNodePath
graphLinksModel.GroupNodePath = value

Gets or sets a property path that that specifies how to get the key for "container" or group node data of a node data object.

LinkCategoryPath
public string LinkCategoryPath { get; set; }
value = graphLinksModel.LinkCategoryPath
graphLinksModel.LinkCategoryPath = value

Gets or sets a property path that that specifies how to find the category of a link data.

LinkFromParameterPath
public string LinkFromParameterPath { get; set; }
value = graphLinksModel.LinkFromParameterPath
graphLinksModel.LinkFromParameterPath = value

Gets or sets a property path that that specifies how to get optional "port" parameter information for the "from" node data of a link data object.

LinkFromPath
public string LinkFromPath { get; set; }
value = graphLinksModel.LinkFromPath
graphLinksModel.LinkFromPath = value

Gets or sets a property path that that specifies how to get the key for the "from" node data of a link data object.

LinkLabelNodePath
public string LinkLabelNodePath { get; set; }
value = graphLinksModel.LinkLabelNodePath
graphLinksModel.LinkLabelNodePath = value

Gets or sets a property path that that specifies how to get the key for the "label" node data of a link data object.

LinksSource
public IEnumerable LinksSource { get; set; }
value = graphLinksModel.LinksSource
graphLinksModel.LinksSource = value

Gets or sets the collection of link data items for the model.

LinkToParameterPath
public string LinkToParameterPath { get; set; }
value = graphLinksModel.LinkToParameterPath
graphLinksModel.LinkToParameterPath = value

Gets or sets a property path that that specifies how to get optional "port" parameter information for the "to" node data of a link data object.

LinkToPath
public string LinkToPath { get; set; }
value = graphLinksModel.LinkToPath
graphLinksModel.LinkToPath = value

Gets or sets a property path that that specifies how to get the key for the "to" node data of a link data object.

MemberNodesPath
public string MemberNodesPath { get; set; }
value = graphLinksModel.MemberNodesPath
graphLinksModel.MemberNodesPath = value

Gets or sets a property path that that specifies how to get a list of keys for the "member" nodes of a group node data object.

NodeCategoryPath
public string NodeCategoryPath { get; set; }
value = graphLinksModel.NodeCategoryPath
graphLinksModel.NodeCategoryPath = value

Gets or sets a property path that that specifies how to find the category of a node data.

NodeIsGroupPath
public string NodeIsGroupPath { get; set; }
value = graphLinksModel.NodeIsGroupPath
graphLinksModel.NodeIsGroupPath = value

Gets or sets a property path that that specifies how to find out whether a node data is also a "container" group.

NodeIsLinkLabelPath
public string NodeIsLinkLabelPath { get; set; }
value = graphLinksModel.NodeIsLinkLabelPath
graphLinksModel.NodeIsLinkLabelPath = value

Gets or sets a property path that that specifies how to find out whether a node data is also a "label" for a link data.

NodeKeyIsNodeData
public bool NodeKeyIsNodeData { get; set; }
value = graphLinksModel.NodeKeyIsNodeData
graphLinksModel.NodeKeyIsNodeData = value

Gets or sets whether all node data are also their own keys.

NodeKeyPath
public string NodeKeyPath { get; set; }
value = graphLinksModel.NodeKeyPath
graphLinksModel.NodeKeyPath = value

Gets or sets a property path that that specifies how to get the key for node data.

NodeKeyReferenceAutoInserts
public bool NodeKeyReferenceAutoInserts { get; set; }
value = graphLinksModel.NodeKeyReferenceAutoInserts
graphLinksModel.NodeKeyReferenceAutoInserts = value

Gets or sets whether a reference, when NodeKeyIsNodeData is true, automatically inserts the node into NodesSource.

NodesSource
public IEnumerable NodesSource { get; set; }
value = graphLinksModel.NodesSource
graphLinksModel.NodesSource = value

Gets or sets the collection of node data items for the model.

ValidCycle
public ValidCycle ValidCycle { get; set; }
value = graphLinksModel.ValidCycle
graphLinksModel.ValidCycle = value

Specify what kinds of graphs this model allows.

Methods

AddCollectionCopy(GraphLinksModel{, GraphLinksModel{) : CopyDictionary<T, T, T, T>

Copy existing node and link data and add to this model.

coll
the collection of data to be copied
env
the ICopyDictionary used to keep track of copied objects; if null, the method will call CreateCopyDictionary, use it, and return it

Returns: the updated copy dictionary, mapping original data to copied data

AddLinkCopy
public LinkType AddLinkCopy(LinkType linkdata)
result = graphLinksModel.AddLinkCopy(linkdata)

Add a copy of a link data to this model.

linkdata

Returns: the copied link data

AddMemberNodeKey
public void AddMemberNodeKey(NodeType nodedata, NodeKey memberkey)
graphLinksModel.AddMemberNodeKey(nodedata, memberkey)

Add a "member" node data's key value to a node data's list of "members".

nodedata
the node data to be modified
memberkey
the key value of the new "member" node data
AddNode
public void AddNode(NodeType nodedata)
graphLinksModel.AddNode(nodedata)

Add a node data to NodesSource.

nodedata
AddNodeCopy
public NodeType AddNodeCopy(NodeType nodedata)
result = graphLinksModel.AddNodeCopy(nodedata)

Add a copy of a node data to this model.

nodedata

Returns: the copied node data

AugmentCopyCollection(GraphLinksModel{)

Override this method to add more (related) data to be copied.

coll
the collection of data to be copied
AugmentCopyDictionary(GraphLinksModel{)

Override this method to avoid copying some data, or to change how copied references are resolved.

env
the dictionary mapping original objects to copied objects
ChangeDataValue
protected override void ChangeDataValue(ModelChangedEventArgs e, bool undo)
graphLinksModel.ChangeDataValue(e, undo)

This is called during undo or redo to effect state changes to model data.

e
an edit describing the change to be performed
undo
true if undoing; false if redoing
ChangeModelValue
protected override void ChangeModelValue(ModelChangedEventArgs e, bool undo)
graphLinksModel.ChangeModelValue(e, undo)

This is called during undo or redo to effect state changes to this model.

e
an edit describing the change to be performed
undo
true if undoing; false if redoing
CheckLinkValid
protected virtual bool CheckLinkValid(NodeType fromdata, PortKey fromparam, NodeType todata, PortKey toparam, bool ignoreexistinglink, LinkType oldlinkdata)
result = graphLinksModel.CheckLinkValid(fromdata, fromparam, todata, toparam, ignoreexistinglink, oldlinkdata)

This predicate is true if adding a link between two nodes/ports would result in a validly structured graph.

fromdata
a node key identifying the node data from which the link comes
fromparam
an optional value identifying which port on the "from" node the link is connected to
todata
a node key identify the node data to which the link goes
toparam
an optional value identifying which port on the "to" node the link is connected to
ignoreexistinglink
true if relinking; false if adding a new link
oldlinkdata
the original link data that might be modified, if is true

Returns: The behavior of this predicate depends on the value of ValidCycle and ValidUnconnectedLinks.

CheckMemberValid
protected virtual bool CheckMemberValid(NodeType groupnodedata, NodeType membernodedata, bool ignoreexistingmembership)
result = graphLinksModel.CheckMemberValid(groupnodedata, membernodedata, ignoreexistingmembership)

This predicate is true if adding a node to a group node would result in an invalid graph.

groupnodedata
the node data that is a group
membernodedata
a node data to be considered for adding to the group
ignoreexistingmembership
whether to ignore the 's existing group membership, because that member is being transferred out of its existing group

Returns: This returns false for membership that would break the tree structure of the model's graph of groups.

ClearUnresolvedReferences
public void ClearUnresolvedReferences()
graphLinksModel.ClearUnresolvedReferences()

Forget all unresolved delayed or forward references.

CopyLink1(T, GraphLinksModel{) : T

This is the first pass of copying link data, responsible for constructing a copy and copying most of its properties.

linkdata
env
the dictionary mapping original objects to copied objects

Returns: the copied link data

CopyLink2(T, GraphLinksModel{, T, T, T, T)

This is the second pass of copying link data, responsible for fixing up references to other objects.

oldlinkdata
the original link data
env
the dictionary mapping original objects to copied objects
newlinkdata
the copied link data
newfromnodedata
for convenience, the copied "from" node
newtonodedata
for convenience, the copied "to" node
newlinklabel
for convenience, the copied "label" node
CopyNode1(T, GraphLinksModel{) : T

This is the first pass of copying node data, responsible for constructing a copy and copying most of its properties.

nodedata
env
the dictionary mapping original objects to copied objects

Returns: the copied node data

CopyNode2(T, GraphLinksModel{, T, T, IEnumerable<T>)

This is the second pass of copying node data, responsible for fixing up references to other objects.

oldnodedata
the original node data
env
the dictionary mapping original objects to copied objects
newnodedata
the copied node data
newgroup
for convenience, the copied "parent" node data
newmembers
for convenience, a list of newly copied member nodes
CreateCopyDictionary
public virtual CopyDictionary<NodeType, NodeKey, PortKey, LinkType> CreateCopyDictionary()
result = graphLinksModel.CreateCopyDictionary()

Create an ICopyDictionary initialized for this model.

Returns: Normally this will be an empty dictionary.

CreateDataCollection
public virtual DataCollection<NodeType, NodeKey, PortKey, LinkType> CreateDataCollection()
result = graphLinksModel.CreateDataCollection()

Create an empty IDataCollection for this model.

CreateInitializedCopy(GraphLinksModel{) : GraphLinksModel<T, T, T, T>

Make a copy of this model, without sharing the NodesSource or LinksSource collections.

init
This is a DataCollection that provides the initial node and link data. (Such data is not copied.) If this is null, the initial NodesSource and LinksSource values are empty collections.

Returns: a model just like this one, but with different data

DeleteMemberNodeKey
protected virtual void DeleteMemberNodeKey(NodeType nodedata, NodeKey memberkey)
graphLinksModel.DeleteMemberNodeKey(nodedata, memberkey)

This method actually implements the modification of a node data so that it's collection of children node data does not include a given .

nodedata
the node data to be modified; if null, this method does nothing
memberkey
the key value of the "member" node data; if null, this method does nothing
DeleteNode
protected virtual void DeleteNode(NodeType nodedata)
graphLinksModel.DeleteNode(nodedata)

This method actually implements the removal of a node data from the NodesSource collection.

nodedata
DoGroupNodeChanged
public void DoGroupNodeChanged(NodeType nodedata)
graphLinksModel.DoGroupNodeChanged(nodedata)

This should be called when a node data's membership in a group may have changed.

nodedata
the modified node data
DoLinkAdded
public void DoLinkAdded(LinkType linkdata)
graphLinksModel.DoLinkAdded(linkdata)

This should be called when a link data object is added to the LinksSource collection.

linkdata
DoLinkCategoryChanged
public void DoLinkCategoryChanged(LinkType linkdata)
graphLinksModel.DoLinkCategoryChanged(linkdata)

This should be called when a link data's category value may have changed.

linkdata
DoLinkLabelChanged
public void DoLinkLabelChanged(LinkType linkdata)
graphLinksModel.DoLinkLabelChanged(linkdata)

This should be called when a link data's label node may have changed.

linkdata
DoLinkPortsChanged
public void DoLinkPortsChanged(LinkType linkdata)
graphLinksModel.DoLinkPortsChanged(linkdata)

This should be called when a link data's connected node or port, either "from" or "to", may have changed.

linkdata
DoLinkRemoved
public void DoLinkRemoved(LinkType linkdata)
graphLinksModel.DoLinkRemoved(linkdata)

This should be called when a link data object is removed from the LinksSource collection.

linkdata
DoMemberNodeKeyAdded
public void DoMemberNodeKeyAdded(NodeType nodedata, NodeKey memberkey)
graphLinksModel.DoMemberNodeKeyAdded(nodedata, memberkey)

This should be called when a "member" node data key has been added to the collection of "member" node keys.

nodedata
the modified node data
memberkey
the key for the added "member" node data
DoMemberNodeKeyRemoved
public void DoMemberNodeKeyRemoved(NodeType nodedata, NodeKey memberkey)
graphLinksModel.DoMemberNodeKeyRemoved(nodedata, memberkey)

This should be called when a "member" node data key has been removed from the collection of "member" node keys.

nodedata
the modified node data
memberkey
the key for the removed "member" node data
DoMemberNodeKeysChanged
public void DoMemberNodeKeysChanged(NodeType nodedata)
graphLinksModel.DoMemberNodeKeysChanged(nodedata)

This should be called when a node data's list of "member" nodes has been replaced.

nodedata
DoNodeAdded
public void DoNodeAdded(NodeType nodedata)
graphLinksModel.DoNodeAdded(nodedata)

This should be called when a node data object is added to the NodesSource collection.

nodedata
DoNodeCategoryChanged
public void DoNodeCategoryChanged(NodeType nodedata)
graphLinksModel.DoNodeCategoryChanged(nodedata)

This should be called when a node data's category value may have changed.

nodedata
DoNodeKeyChanged
public void DoNodeKeyChanged(NodeType nodedata)
graphLinksModel.DoNodeKeyChanged(nodedata)

This should be called when a node data's key value may have changed.

nodedata
DoNodeRemoved
public void DoNodeRemoved(NodeType nodedata)
graphLinksModel.DoNodeRemoved(nodedata)

This should be called when a node data object is removed from the NodesSource collection.

nodedata
FindCategoryForNode
protected virtual string FindCategoryForNode(NodeType nodedata)
result = graphLinksModel.FindCategoryForNode(nodedata)

Find the category of a node data.

nodedata

Returns: by default an empty string

FindGroupKeyForNode
protected virtual NodeKey FindGroupKeyForNode(NodeType nodedata)
result = graphLinksModel.FindGroupKeyForNode(nodedata)

Find containing group node key for a given node data, if any.

nodedata

Returns: a for the containing group node, or the default value for that type if there is no container node for the node

FindIsGroupForNode
protected virtual bool FindIsGroupForNode(NodeType nodedata)
result = graphLinksModel.FindIsGroupForNode(nodedata)

Find whether a node data is a group or container of other nodes.

nodedata
FindIsLinkLabelForNode
protected virtual bool FindIsLinkLabelForNode(NodeType nodedata)
result = graphLinksModel.FindIsLinkLabelForNode(nodedata)

Find whether a node data is a "label" for a link data.

nodedata
FindKeyForNode
protected virtual NodeKey FindKeyForNode(NodeType nodedata)
result = graphLinksModel.FindKeyForNode(nodedata)

Find the key for node data.

nodedata

Returns: the (hopefully) unique key for the given node data in this model

FindMemberNodeKeysForNode
protected virtual IEnumerable FindMemberNodeKeysForNode(NodeType nodedata)
result = graphLinksModel.FindMemberNodeKeysForNode(nodedata)

Find the list of keys of the children nodes for a node data object.

nodedata

Returns: the list of child keys, an IEnumerable of

FindNodeByKey
public NodeType FindNodeByKey(NodeKey key)
result = graphLinksModel.FindNodeByKey(key)

Given a key, find the node data with that key.

key
a value of null for this argument will result in the default value for

Returns: a ; the value will be the default for the type if no such node data is known to be in this model

GetCategoryForNode
public string GetCategoryForNode(NodeType nodedata)
result = graphLinksModel.GetCategoryForNode(nodedata)

This method gets the category of a node.

nodedata

Returns: a String, defaulting to the empty string

GetConnectedNodesForNode
public IEnumerable<NodeType> GetConnectedNodesForNode(NodeType nodedata, Predicate<PortKey> portpred)
result = graphLinksModel.GetConnectedNodesForNode(nodedata, portpred)

Return a sequence of node data that are directly connected to a given node, in either direction.

nodedata
portpred
a predicate to be applied to each port parameter; if non-null, this predicate must be true for the node to be included in the return sequence

Returns: an IEnumerable

GetConnectedNodesForNode
public IEnumerable<NodeType> GetConnectedNodesForNode(NodeType nodedata)
result = graphLinksModel.GetConnectedNodesForNode(nodedata)

Return a sequence of node data that are directly connected to a given node, in either direction.

nodedata

Returns: an IEnumerable

GetFromLinksForNode
public IEnumerable<LinkType> GetFromLinksForNode(NodeType nodedata)
result = graphLinksModel.GetFromLinksForNode(nodedata)

Return a sequence of link data that are connnected at a given node data, only going into the given node.

nodedata

Returns: an IEnumerable

GetFromNodesForNode
public IEnumerable<NodeType> GetFromNodesForNode(NodeType nodedata)
result = graphLinksModel.GetFromNodesForNode(nodedata)

Return a sequence of node data that are directly connected by links going into a given node.

nodedata

Returns: an IEnumerable

GetFromNodesForNode
public IEnumerable<NodeType> GetFromNodesForNode(NodeType nodedata, Predicate<PortKey> toportpred)
result = graphLinksModel.GetFromNodesForNode(nodedata, toportpred)

Return a sequence of node data that are directly connected by links going into a given node.

nodedata
toportpred
a predicate to be applied to each "to" port parameter; if non-null, this predicate must be true for the "from" node to be included in the return sequence

Returns: an IEnumerable

GetGroupForNode
public NodeType GetGroupForNode(NodeType nodedata)
result = graphLinksModel.GetGroupForNode(nodedata)

Return the container group node data for a given node data, if there is one.

nodedata

Returns: a node data

GetHasLabeledLinkForNode
public bool GetHasLabeledLinkForNode(NodeType nodedata)
result = graphLinksModel.GetHasLabeledLinkForNode(nodedata)

This predicate is true for a node data if it is associated with a link data as its "label".

nodedata
GetIsGroupForNode
public bool GetIsGroupForNode(NodeType nodedata)
result = graphLinksModel.GetIsGroupForNode(nodedata)

This predicate is true if a given node data may be a group (i.e. a container) of other nodes.

nodedata
GetIsLinkLabelForNode
public bool GetIsLinkLabelForNode(NodeType nodedata)
result = graphLinksModel.GetIsLinkLabelForNode(nodedata)

This predicate is true if the given node data may be used as a "label" for a link.

nodedata
GetLabeledLinkForNode
public LinkType GetLabeledLinkForNode(NodeType nodedata)
result = graphLinksModel.GetLabeledLinkForNode(nodedata)

Get the link data that refers to a given node data as its "label".

nodedata

Returns: a link data

GetLinksBetweenNodes
public IEnumerable<LinkType> GetLinksBetweenNodes(NodeType fromdata, PortKey fromparam, NodeType todata, PortKey toparam)
result = graphLinksModel.GetLinksBetweenNodes(fromdata, fromparam, todata, toparam)

Return a sequence of all link data that go from one node to another, possibly restricted to certain "ports".

fromdata
a node key identifying the node data from which the link comes
fromparam
an optional value identifying which port on the "from" node the link is connected to
todata
a node key identify the node data to which the link goes
toparam
an optional value identifying which port on the "to" node the link is connected to

Returns: an IEnumerable

GetLinksForNode
public IEnumerable<LinkType> GetLinksForNode(NodeType nodedata)
result = graphLinksModel.GetLinksForNode(nodedata)

Return a sequence of link data that are connnected at a given node data, in either direction.

nodedata

Returns: an IEnumerable

GetLinksForNode
public IEnumerable<LinkType> GetLinksForNode(NodeType nodedata, Predicate<LinkType> predicate)
result = graphLinksModel.GetLinksForNode(nodedata, predicate)

Return a sequence of link data that are connnected at a given node data, in either direction, that satisfy a given predicate.

nodedata
predicate
a delegate that takes a as an argument and returns a boolean

Returns: an IEnumerable

GetMemberLinksForGroup
public IEnumerable<LinkType> GetMemberLinksForGroup(NodeType nodedata)
result = graphLinksModel.GetMemberLinksForGroup(nodedata)

Return a sequence of link data that are contained by a given node data.

nodedata

Returns: an IEnumerable of member link data; an empty sequence if there are no member links

GetMemberNodesForGroup
public IEnumerable<NodeType> GetMemberNodesForGroup(NodeType nodedata)
result = graphLinksModel.GetMemberNodesForGroup(nodedata)

Return a sequence of node data that are immediate members of a given node data.

nodedata

Returns: an IEnumerable of member node data; an empty sequence if there are no members

GetNodeType
public Type GetNodeType()
result = graphLinksModel.GetNodeType()

Return the .

Returns: a Type, not a node data object, nor a string

GetToLinksForNode
public IEnumerable<LinkType> GetToLinksForNode(NodeType nodedata)
result = graphLinksModel.GetToLinksForNode(nodedata)

Return a sequence of link data that are connnected at a given node data, only coming out of the given node.

nodedata

Returns: an IEnumerable

GetToNodesForNode
public IEnumerable<NodeType> GetToNodesForNode(NodeType nodedata, Predicate<PortKey> fromportpred)
result = graphLinksModel.GetToNodesForNode(nodedata, fromportpred)

Return a sequence of node data that are directly connected by links coming out from a given node.

nodedata
fromportpred
a predicate to be applied to each "from" port parameter; if non-null, this predicate must be true for the "to" node to be included in the return sequence

Returns: an IEnumerable

GetToNodesForNode
public IEnumerable<NodeType> GetToNodesForNode(NodeType nodedata)
result = graphLinksModel.GetToNodesForNode(nodedata)

Return a sequence of node data that are directly connected by links coming out from a given node.

nodedata

Returns: an IEnumerable

HandleLinkPropertyChanged
protected virtual void HandleLinkPropertyChanged(object sender, PropertyChangedEventArgs e)
graphLinksModel.HandleLinkPropertyChanged(sender, e)

This is the INotifyPropertyChanged event handler for link data.

sender
e
preferably a ModelChangedEventArgs that describes what changed and how
HandleNodePropertyChanged
protected virtual void HandleNodePropertyChanged(object sender, PropertyChangedEventArgs e)
graphLinksModel.HandleNodePropertyChanged(sender, e)

This is the INotifyPropertyChanged event handler for node data.

sender
e
preferably a ModelChangedEventArgs that describes what changed and how
InsertMemberNodeKey
protected virtual void InsertMemberNodeKey(NodeType nodedata, NodeKey memberkey)
graphLinksModel.InsertMemberNodeKey(nodedata, memberkey)

This method actually implements the modification of a node data so that it's collection of member node data includes a given .

nodedata
the node data to be modified; if null, this method does nothing
memberkey
the key value of the new "member" node data; if null, this method does nothing
InsertNode
protected virtual void InsertNode(NodeType nodedata)
graphLinksModel.InsertNode(nodedata)

This method actually implements the addition of a node data to the NodesSource collection.

nodedata
IsEqualPortParameters
protected virtual bool IsEqualPortParameters(PortKey a, PortKey b)
result = graphLinksModel.IsEqualPortParameters(a, b)

This predicate compares two values and returns true if they are "equal".

a
b

Returns: Normally this uses the default EqualityComparer for the type. But you may need to override this method if that kind of equality comparison is inappropriate for your port information.

IsLinkData
public bool IsLinkData(LinkType linkdata)
result = graphLinksModel.IsLinkData(linkdata)

This predicate is true if the argument is a link data in this model.

linkdata
the object to be checked to see if it is a known link data in this model

Returns: true if the is in the LinksSource

IsLinked
public bool IsLinked(NodeType fromdata, PortKey fromparam, NodeType todata, PortKey toparam)
result = graphLinksModel.IsLinked(fromdata, fromparam, todata, toparam)

This predicate is true if there is a link from one node data/port to another one.

fromdata
a node key identifying the node data from which the link comes
fromparam
an optional value identifying which port on the "from" node the link is connected to
todata
a node key identify the node data to which the link goes
toparam
an optional value identifying which port on the "to" node the link is connected to
IsLinkType
public bool IsLinkType(object linkdata)
result = graphLinksModel.IsLinkType(linkdata)

Return the .

Returns: a Type, not a link data object, nor a string

IsLinkValid
public bool IsLinkValid(NodeType fromdata, PortKey fromparam, NodeType todata, PortKey toparam)
result = graphLinksModel.IsLinkValid(fromdata, fromparam, todata, toparam)

This predicate is true if adding a link between two nodes/ports would result in a valid graph.

fromdata
a node key identifying the node data from which the link comes
fromparam
an optional value identifying which port on the "from" node the link is connected to
todata
a node key identify the node data to which the link goes
toparam
an optional value identifying which port on the "to" node the link is connected to
IsMember
public bool IsMember(NodeType groupnodedata, NodeType membernodedata)
result = graphLinksModel.IsMember(groupnodedata, membernodedata)

This predicate is true if the is a member of the container group.

groupnodedata
membernodedata
IsMemberValid
public bool IsMemberValid(NodeType groupnodedata, NodeType membernodedata, bool ignoreexistingmembership)
result = graphLinksModel.IsMemberValid(groupnodedata, membernodedata, ignoreexistingmembership)

This predicate is true if adding to a group node () would result in an invalid graph.

groupnodedata
the node data that is a group
membernodedata
a node data
ignoreexistingmembership
whether to ignore the 's existing group membership, because that member is being transferred out of its existing group
IsNodeData
public bool IsNodeData(NodeType nodedata)
result = graphLinksModel.IsNodeData(nodedata)

This predicate is true if the argument is a node data in this model.

nodedata
the object to be checked to see if it is a known node data in this model

Returns: true if the is in the NodesSource

IsNodeType
public bool IsNodeType(object nodedata)
result = graphLinksModel.IsNodeType(nodedata)

This predicate is true when the argument is an instance of .

nodedata
the arbitrary object to be checked for compatibility to be a node data

Returns: true if the can be cast to the ; false otherwise

IsRelinkValid
public bool IsRelinkValid(NodeType fromdata, PortKey fromparam, NodeType todata, PortKey toparam, LinkType oldlinkdata)
result = graphLinksModel.IsRelinkValid(fromdata, fromparam, todata, toparam, oldlinkdata)

This predicate is true if replacing a link between two nodes/ports would result in a valid graph.

fromdata
a node key identifying the node data from which the link comes
fromparam
an optional value identifying which port on the "from" node the link is connected to
todata
a node key identify the node data to which the link goes
toparam
an optional value identifying which port on the "to" node the link is connected to
oldlinkdata
the original link data that might be modified
Load``2
public void Load<NodeDataType, LinkDataType>(XContainer root, XName nodename, XName linkname)
graphLinksModel.Load(root, nodename, linkname)

Given a Linq for XML XContainer holding node and link data, replace this model's NodesSource and LinksSource collections with collections of new node data and new link data.

root
the XContainer holding all of the data
nodename
the name of each XElement holding node data
linkname
the name of each XElement holding link data
Load``2
public void Load<NodeDataType, LinkDataType>(XContainer root, Func<XElement, NodeDataType> nodedataallocator, Func<XElement, LinkDataType> linkdataallocator)
graphLinksModel.Load(root, nodedataallocator, linkdataallocator)

Given a Linq for XML XContainer holding node and link data, replace this model's NodesSource and LinksSource collections with collections of new node data and new link data.

root
the XContainer holding all of the data
nodedataallocator
a function that takes an XElement and returns either a newly constructed object of type or null if that XElement is to be ignored
linkdataallocator
a function that takes an XElement and returns either a newly constructed object of type or null if that XElement is to be ignored
MakeNodeKeyUnique
protected virtual bool MakeNodeKeyUnique(NodeType nodedata)
result = graphLinksModel.MakeNodeKeyUnique(nodedata)

This method is called when a duplicate key has been found.

nodedata

Returns: true to accept the data as a node after having made the key unique in the model; false to ignore this data.

ModifyGroupNodeKey
protected virtual void ModifyGroupNodeKey(NodeType nodedata, NodeKey groupkey)
graphLinksModel.ModifyGroupNodeKey(nodedata, groupkey)

This method actually implements the modification of a node data so that its reference to a containing group node data (if any) is the given .

nodedata
the node data to be modified
groupkey
the key value of the "group" node data
ModifyLinkFromPort
protected virtual void ModifyLinkFromPort(LinkType linkdata, NodeKey nodekey, PortKey portparam)
graphLinksModel.ModifyLinkFromPort(linkdata, nodekey, portparam)

This method actually implements the modification of a link data to change the reference to the "from" node data and the link's "from" port information.

linkdata
the link data to be modified
nodekey
the new node data's
portparam
ModifyLinkLabelKey
protected virtual void ModifyLinkLabelKey(LinkType linkdata, NodeKey linklabelkey)
graphLinksModel.ModifyLinkLabelKey(linkdata, linklabelkey)

This method actually implements the modification of a link data to change the reference to the "label" node data.

linkdata
the link data to be modified
linklabelkey
the new label data's
ModifyLinkToPort
protected virtual void ModifyLinkToPort(LinkType linkdata, NodeKey nodekey, PortKey portparam)
graphLinksModel.ModifyLinkToPort(linkdata, nodekey, portparam)

This method actually implements the modification of a link data to change the reference to the "to" node data and the link's "to" port information.

linkdata
the link data to be modified
nodekey
the new node data's
portparam
ModifyMemberNodeKeys
protected virtual void ModifyMemberNodeKeys(NodeType nodedata, IEnumerable membernodekeys)
graphLinksModel.ModifyMemberNodeKeys(nodedata, membernodekeys)

This method actually implements the replacement of a group node data's collection of member node keys.

nodedata
the node data to be modified
membernodekeys
a sequence of "member" node data key values
RemoveMemberNodeKey
public void RemoveMemberNodeKey(NodeType nodedata, NodeKey memberkey)
graphLinksModel.RemoveMemberNodeKey(nodedata, memberkey)

Remove a child node data's key value from a group node data's list of "member" key values.

nodedata
the node data to be modified
memberkey
the key value of the "member" node data
RemoveNode
public void RemoveNode(NodeType nodedata)
graphLinksModel.RemoveNode(nodedata)

Remove a node data from NodesSource.

nodedata
ResolveAllReferences
public void ResolveAllReferences()
graphLinksModel.ResolveAllReferences()

Cause ResolveNodeKey( to be called on each known delayed or forward node reference.

ResolveNodeKey
protected virtual void ResolveNodeKey(NodeKey nodekey)
graphLinksModel.ResolveNodeKey(nodekey)

This is called repeatedly by ResolveAllReferences, once for each known delayed or forward node reference.

nodekey
Save``2
public XElement Save<NodeDataType, LinkDataType>(XName rootname, XName nodename, XName linkname)
result = graphLinksModel.Save(rootname, nodename, linkname)

Generate a Linq for XML XElement holding all of the node and link data.

rootname
the name of the returned XElement
nodename
the name of each XElement holding node data
linkname
the name of each XElement holding link data

Returns: an XElement

SetGroupNodeKey
public void SetGroupNodeKey(NodeType nodedata, NodeKey groupkey)
graphLinksModel.SetGroupNodeKey(nodedata, groupkey)

Change a node data so that it refers to a different container group node data, by node key.

nodedata
the node data to be modified
groupkey
the key value of the new "group" node data
SetLinkFromPort
public void SetLinkFromPort(LinkType linkdata, NodeKey nodekey, PortKey portparam)
graphLinksModel.SetLinkFromPort(linkdata, nodekey, portparam)

Change a link data so that it refers to a different "from" node data and associated port information.

linkdata
the link data to be modified
nodekey
the new node data's
portparam
SetLinkLabelKey
public void SetLinkLabelKey(LinkType linkdata, NodeKey linklabelkey)
graphLinksModel.SetLinkLabelKey(linkdata, linklabelkey)

Change a link data so that it refers to a different "label" node data.

linkdata
the link data to be modified
linklabelkey
the new label data's
SetLinkToPort
public void SetLinkToPort(LinkType linkdata, NodeKey nodekey, PortKey portparam)
graphLinksModel.SetLinkToPort(linkdata, nodekey, portparam)

Change a link data so that it refers to a different "to" node data and associated port information.

linkdata
the link data to be modified
nodekey
the new node data's
portparam
SetMemberNodeKeys
public void SetMemberNodeKeys(NodeType nodedata, IEnumerable membernodekeys)
graphLinksModel.SetMemberNodeKeys(nodedata, membernodekeys)

Replace a node data's list of "member" key values.

nodedata
the node data to be modified
membernodekeys
a sequence of "member" node data key values