Table of Contents

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

Namespace
Northwoods.Go.Models
Assembly
Northwoods.GoDiagram.WinForms.dll

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

public class GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.LinkData : ICloneable
Inheritance
GraphLinksModel<TNodeData, TNodeKey, TSharedData, TLinkData, TLinkKey, TPort>.LinkData
Implements
Inherited Members

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; } }

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.

Properties

Category

Gets or sets the category for this link data.

public virtual string Category { get; set; }

Property Value

string

Remarks

The default value is the empty string.

From

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

public virtual TNodeKey From { get; set; }

Property Value

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.

public virtual TPort FromPort { get; set; }

Property Value

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.

public virtual TLinkKey Key { get; set; }

Property Value

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.

public virtual string Text { get; set; }

Property Value

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.

public virtual TNodeKey To { get; set; }

Property Value

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.

public virtual TPort ToPort { get; set; }

Property Value

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.

public virtual object Clone()

Returns

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.