GraphLinksModelLinkData

StockSharp.Xaml.Diagram.GXDiagram.Model

A simple representation of link data that supports property change notification, copying, and undo via the INotifyPropertyChanged, ICloneable, and IChangeDataValue interfaces.

Implements: INotifyPropertyChanged, IChangeDataValue, ICloneable

Constructors

GraphLinksModelLinkData
public GraphLinksModelLinkData()
graphLinksModelLinkData = GraphLinksModelLinkData()

The default constructor produces an empty object with no references to nodes.

GraphLinksModelLinkData
public GraphLinksModelLinkData(NodeKey from, PortKey fromport, NodeKey to, PortKey toport)
graphLinksModelLinkData = GraphLinksModelLinkData(from, fromport, to, toport)

This constructor initializes the From and To properties.

from
a node key identifying the node data from which the link comes
fromport
an optional value identifying which port on the "from" node the link is connected to
to
a node key identify the node data to which the link goes
toport
an optional value identifying which port on the "to" node the link is connected to
GraphLinksModelLinkData
public GraphLinksModelLinkData(NodeKey from, NodeKey to)
graphLinksModelLinkData = GraphLinksModelLinkData(from, to)

This constructor initializes the From and To properties.

from
to

Properties

Category
public string Category { get; set; }
value = graphLinksModelLinkData.Category
graphLinksModelLinkData.Category = value

Gets or sets a String that names the category to which the link data belongs.

From
public NodeKey From { get; set; }
value = graphLinksModelLinkData.From
graphLinksModelLinkData.From = value

Gets or sets the key value of the node from which this link comes.

FromPort
public PortKey FromPort { get; set; }
value = graphLinksModelLinkData.FromPort
graphLinksModelLinkData.FromPort = value

Gets or sets the optional parameter information for the From node's port.

LabelNode
public NodeKey LabelNode { get; set; }
value = graphLinksModelLinkData.LabelNode
graphLinksModelLinkData.LabelNode = value

Gets or sets the key value of the node which is on this link acting as if it were a label.

Points
public IEnumerable<Point> Points { get; set; }
value = graphLinksModelLinkData.Points
graphLinksModelLinkData.Points = value

Gets or sets a collection of Points used to define the path of the link.

Text
public string Text { get; set; }
value = graphLinksModelLinkData.Text
graphLinksModelLinkData.Text = value

Gets or sets a string that can be used for a text label on a link.

To
public NodeKey To { get; set; }
value = graphLinksModelLinkData.To
graphLinksModelLinkData.To = value

Gets or sets the key value of the node to which this link goes.

ToPort
public PortKey ToPort { get; set; }
value = graphLinksModelLinkData.ToPort
graphLinksModelLinkData.ToPort = value

Gets or sets the optional parameter information for the To node's port.

Methods

ChangeDataValue
public virtual void ChangeDataValue(ModelChangedEventArgs e, bool undo)
graphLinksModelLinkData.ChangeDataValue(e, undo)

This method implements the IChangeDataValue interface, used to perform state changes for undo and redo.

e
an edit describing the change to be performed
undo
true if undoing; false if redoing
Clone
public virtual object Clone()
result = graphLinksModelLinkData.Clone()

Create a copy of this data; this implements the ICloneable interface.

ConvertNodeKeyToString
protected virtual string ConvertNodeKeyToString(NodeKey key)
result = graphLinksModelLinkData.ConvertNodeKeyToString(key)

Convert a key value to a string.

key

Returns: a String from which String) can recover the original key value

ConvertPortKeyToString
protected virtual string ConvertPortKeyToString(PortKey key)
result = graphLinksModelLinkData.ConvertPortKeyToString(key)

Convert a key value to a string.

key

Returns: a String from which String) can recover the original key value

ConvertStringToNodeKey
protected virtual NodeKey ConvertStringToNodeKey(string s)
result = graphLinksModelLinkData.ConvertStringToNodeKey(s)

Convert a string to a key value.

s

Returns: a

ConvertStringToPortKey
protected virtual PortKey ConvertStringToPortKey(string s)
result = graphLinksModelLinkData.ConvertStringToPortKey(s)

Convert a string to a key value.

s

Returns: a

LoadFromXElement
public virtual void LoadFromXElement(XElement e)
graphLinksModelLinkData.LoadFromXElement(e)

Initialize this link data with data held in a Linq for XML XElement.

e
the XElement
MakeXElement
public virtual XElement MakeXElement(XName n)
result = graphLinksModelLinkData.MakeXElement(n)

Constructs a Linq for XML XElement holding the data of this link.

n
the name of the new XElement

Returns: an initialized XElement

OnPropertyChanged
public virtual void OnPropertyChanged(ModelChangedEventArgs e)
graphLinksModelLinkData.OnPropertyChanged(e)

Raise the PropertyChanged event.

e
RaisePropertyChanged
protected void RaisePropertyChanged(string pname, object oldval, object newval)
graphLinksModelLinkData.RaisePropertyChanged(pname, oldval, newval)

Call this method from property setters to raise the PropertyChanged event.

pname
the property name
oldval
the value before the property was set
newval
the new value
ToString
public override string ToString()
result = graphLinksModelLinkData.ToString()

For debugging, use the From and To properties as this object's default text rendering.

Returns: a String like "Node1 --> Node2"

Events

PropertyChanged
public event PropertyChangedEventHandler PropertyChanged
graphLinksModelLinkData.PropertyChanged += handler

This event implements the INotifyPropertyChanged interface, so that both the model and the dependency object system can be informed of changes to property values.