Hi All
I am using the GraphNode class as found in the Demo Project - FlowCharter.
I have also created a custom class which holds details which I need to store against each GraphNode. This class just contains a few string and int fields. When I initialise a new GraphNode I initialise the custom object like so:
<span =“Apple-tab-span” style=“white-space:pre”> public GraphNode(GraphNodeKind k)
{
//Initialise my custom object
fORPSettings = new GraphNodeORPSettings();
InitCommon();
this.Kind = k;
fORPSettings.Description = this.Text;
}
When my app starts I create a GoPalette and add two GraphNode types like so:
<span =“Apple-tab-span” style=“white-space:pre”> GraphNode n;
n = new GraphNode(GraphNodeKind.Step);
myPalette.Document.Add(n);
n = new GraphNode(GraphNodeKind.Decision);
myPalette.Document.Add(n);
Now when I create a Document and drag these node types onto the document I have the ability to edit my custom properties via a propertyGrid. The issue is that If I edit one node’s custom properties, all the other nodes of this type get updated to, like they’re all the same object?
I would have thought that when I drag a GraphNode onto the document it creates a new instance of the GraphNode object? If not, how do I initialise a new instance of the object each time it’s added to the document?
Any help appreciated.
Regards