ILinksModel

StockSharp.Xaml.Diagram.GXDiagram.Model

A model that supports directed link relationships between nodes, with the relationship information stored in separate link data structures.

Implements: IDiagramModel

Properties

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

The collection of link data objects

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

This property controls the overall graph structure that may be drawn.

Methods

AddLinkCopy
public object AddLinkCopy(object linkdata)
result = iLinksModel.AddLinkCopy(linkdata)

Add a copy of a link data to this model.

linkdata

Returns: the newly copied link data

DoLinkAdded
public void DoLinkAdded(object linkdata)
iLinksModel.DoLinkAdded(linkdata)

This method should be called when a link data has been added to the LinksSource collection.

linkdata
DoLinkLabelChanged
public void DoLinkLabelChanged(object linkdata)
iLinksModel.DoLinkLabelChanged(linkdata)

This method must be called when any "label" node is added, removed, or replaced.

linkdata
DoLinkPortsChanged
public void DoLinkPortsChanged(object linkdata)
iLinksModel.DoLinkPortsChanged(linkdata)

This method must be called when either the "from" or the "to" node (or port) has changed.

linkdata
a link data
DoLinkRemoved
public void DoLinkRemoved(object linkdata)
iLinksModel.DoLinkRemoved(linkdata)

This method should be called when a link data has been removed from the LinksSource collection.

linkdata
GetFromLinksForNode
public IEnumerable<object> GetFromLinksForNode(object nodedata)
result = iLinksModel.GetFromLinksForNode(nodedata)

Find all links coming into a given node.

nodedata

Returns: a sequence of link data

GetHasLabeledLinkForNode
public bool GetHasLabeledLinkForNode(object nodedata)
result = iLinksModel.GetHasLabeledLinkForNode(nodedata)

This predicate is true if the given node data is associated with a link data as a label.

nodedata
a node data that is a "label"
GetIsLinkLabelForNode
public bool GetIsLinkLabelForNode(object nodedata)
result = iLinksModel.GetIsLinkLabelForNode(nodedata)

This predicate is true if the given node data acts as a label for a link.

nodedata
a node data
GetLabeledLinkForNode
public object GetLabeledLinkForNode(object nodedata)
result = iLinksModel.GetLabeledLinkForNode(nodedata)

Find the link data with which a label node is associated, if any.

nodedata
a node data that is a "label"

Returns: a link data, or null if there is none

GetLinksBetweenNodes
public IEnumerable<object> GetLinksBetweenNodes(object fromdata, object fromparam, object todata, object toparam)
result = iLinksModel.GetLinksBetweenNodes(fromdata, fromparam, todata, toparam)

Find all links connecting two nodes/ports in one direction.

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: a sequence of link data

GetLinksForNode
public IEnumerable<object> GetLinksForNode(object nodedata, Predicate<object> predicate)
result = iLinksModel.GetLinksForNode(nodedata, predicate)

Find all links connected to a node that satisfy a given predicate.

nodedata
predicate
the predicate takes a single argument, the link data

Returns: a sequence of link data

GetLinksForNode
public IEnumerable<object> GetLinksForNode(object nodedata)
result = iLinksModel.GetLinksForNode(nodedata)

Find all links connected to a node in either direction.

nodedata

Returns: a sequence of link data

GetToLinksForNode
public IEnumerable<object> GetToLinksForNode(object nodedata)
result = iLinksModel.GetToLinksForNode(nodedata)

Find all links going out of a given node.

nodedata

Returns: a sequence of link data

IsLinkData
public bool IsLinkData(object linkdata)
result = iLinksModel.IsLinkData(linkdata)

This predicate is true if the linkdata is in the LinksSource collection.

linkdata
IsLinkType
public bool IsLinkType(object linkdata)
result = iLinksModel.IsLinkType(linkdata)

This predicate is true if the object is non-null and is of a type that the model accepts for link data.

linkdata
IsRelinkValid
public bool IsRelinkValid(object newfromdata, object newfromparam, object newtodata, object newtoparam, object oldlinkdata)
result = iLinksModel.IsRelinkValid(newfromdata, newfromparam, newtodata, newtoparam, oldlinkdata)

This predicate is true if changing an existing link between two nodes/ports would result in a valid graph

newfromdata
a node key identifying the node data from which the new link would come
newfromparam
an optional value identifying which port on the "from" node the link would be connected to
newtodata
a node key identify the node data to which the new link would go
newtoparam
an optional value identifying which port on the "to" node the link would be connected to
oldlinkdata
an existing link that would be deleted
SetLinkFromPort
public void SetLinkFromPort(object linkdata, object nodedata, object portparam)
iLinksModel.SetLinkFromPort(linkdata, nodedata, portparam)

Set the "from" node and port information for a link data.

linkdata
the link data being modified
nodedata
a node data
portparam
SetLinkLabel
public void SetLinkLabel(object linkdata, object labelnodedata)
iLinksModel.SetLinkLabel(linkdata, labelnodedata)

Change the "label" node data for a link data.

linkdata
the link data being modified
labelnodedata
the new node data that is a "label"; may be null to remove the label
SetLinkToPort
public void SetLinkToPort(object linkdata, object nodedata, object portparam)
iLinksModel.SetLinkToPort(linkdata, nodedata, portparam)

Set the "to" node and port information for a link data.

linkdata
the link data being modified
nodedata
a node data
portparam