Class GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.LinkData

GoDiagram®
v10.0.12
by Northwoods Software®

A simple representation of link data that supports property copying via the ICloneable interface.

Inheritance
GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.LinkData
Implements
Namespace: Northwoods.Go.Models
Assembly: Northwoods.GoDiagram.Avalonia.dll
Syntax
public class GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.LinkData : ICloneable
Remarks

You should override the Clone() method if the fields contain data that should not be shared between copies.

Normally, each Key should have a unique value within the model. You can maintain that yourself, by setting the Key to unique values before adding the node data to the model's collection of nodes. Or you can ensure this by overriding the MakeLinkDataKeyUnique(TLinkData) method or providing a MakeUniqueLinkKeyFunction function.

Examples

public class BasicModel : GraphLinksModel<BasicNodeData, string, object, BasicLinkData, string, string> { } public class BasicNodeData : BasicModel.NodeData { public string Color { get; set; } }

public class BasicLinkData : BasicModel.LinkData { public string Color { get; set; } }

Properties

Category

Gets or sets the category for this link data.

Declaration
public virtual string Category { get; set; }
Property Value
Type Description
string
Remarks

The default value is the empty string.

From

Gets or sets the from node key for this link data.

Declaration
public virtual TNodeKey From { get; set; }
Property Value
Type Description
TNodeKey

The type is the parameterized type TNodeKey used for the model, GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.

FromPort

Gets or sets the from port for this link data.

Declaration
public virtual TPort FromPort { get; set; }
Property Value
Type Description
TPort

The type is the parameterized type TPort used for the model, GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.

Key

Gets or sets the key for this link data.

Declaration
public virtual TLinkKey Key { get; set; }
Property Value
Type Description
TLinkKey

The type is the parameterized type TLinkKey used for the model, GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.

Text

Gets or sets the text for this link data.

Declaration
public virtual string Text { get; set; }
Property Value
Type Description
string
Remarks

The default value is null, which will use any text set on the template.

To

Gets or sets the to node key for this link data.

Declaration
public virtual TNodeKey To { get; set; }
Property Value
Type Description
TNodeKey

The type is the parameterized type TNodeKey used for the model, GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.

ToPort

Gets or sets the to port for this link data.

Declaration
public virtual TPort ToPort { get; set; }
Property Value
Type Description
TPort

The type is the parameterized type TPort used for the model, GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.

Methods

Clone()

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

Declaration
public virtual object Clone()
Returns
Type Description
object
Remarks

The default implementation just calls MemberwiseClone. Custom link data classes should override this method if they need to perform any special copying behavior such as deep copying.

Implements