Class Model<TNodeData, TNodeKey, TSharedData>.NodeData
- Namespace
- Northwoods.Go.Models
- Assembly
- Northwoods.GoDiagram.WinForms.dll
A simple representation of node data that supports property copying
via the ICloneable
interface.
public class Model<TNodeData, TNodeKey, TSharedData>.NodeData : ICloneable
- Inheritance
-
Model<TNodeData, TNodeKey, TSharedData>.NodeData
- Implements
- Derived
- Inherited Members
Examples
public class BasicModel : Model<BasicNodeData, string, object> { } public class BasicNodeData : BasicModel.NodeData { 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 MakeNodeDataKeyUnique(TNodeData) method or providing a MakeUniqueKeyFunction function.
Properties
Category
Gets or sets the category for this node data.
public virtual string Category { get; set; }
Property Value
Remarks
The default value is the empty string.
Key
Gets or sets the key for this node data.
public virtual TNodeKey Key { get; set; }
Property Value
- 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.
public virtual Point Location { get; set; }
Property Value
Remarks
The default value is (NaN, NaN).
Text
Gets or sets the text for this node data.
public virtual string Text { get; set; }
Property Value
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.
public virtual object Clone()
Returns
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.