Class Model<TNodeData, TNodeKey, TSharedData>.NodeData

GoDiagram®
v10.0.12
by Northwoods Software®

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

Implements
Namespace: Northwoods.Go.Models
Assembly: Northwoods.GoDiagram.Avalonia.dll
Syntax
public class Model<TNodeData, TNodeKey, TSharedData>.NodeData : 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 MakeNodeDataKeyUnique(TNodeData) method or providing a MakeUniqueKeyFunction function.

Examples

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

Properties

Category

Gets or sets the category for this node data.

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

The default value is the empty string.

Key

Gets or sets the key for this node data.

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

The type is the parameterized type TNodeKey used for the model, Model<TNodeData, TNodeKey, TSharedData>.

Location

Gets or sets the location for this node data.

Declaration
public virtual Point Location { get; set; }
Property Value
Type Description
Point
Remarks

The default value is (NaN, NaN).

Text

Gets or sets the text for this node 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.

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 node data classes should override this method if they need to perform any special copying behavior such as deep copying.

Implements