How to update Shape port UniqueId with some database value??


Author
Message
Niranjan Singh
Niranjan Singh
Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)
Group: Forum Members
Posts: 49, Visits: 179
Scenario: Diagram saved in the database and i need to update the unique id of the Shape ports with the database values.

code snippet:
int portCount = shapeAdded.Ports.ChildrenCount(null);
for (int index = 0; index < portCount; index++)
{
NPort shapePort = shapeAdded.Ports.Children(null)[index] as NPort;

//assigning simobject unique id to nevron as if nevron port unique id
//is changed, connectors will be detached from the shape and can never be
//connected
shapePort.UniqueId = new Guid(portNode.SimUniqueID);
}

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.1K

Assign the ID from the database to the Id property of the shapes, not to the UniqueId one.



Best Regards,
Nevron Support Team


Niranjan Singh
Niranjan Singh
Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)
Group: Forum Members
Posts: 49, Visits: 179
I have litter confusion about the reply that if i change the id of the NPort then does it not make disturbance in connections???


I have class which store then unique of the Shape or Port in the diagram.

SimNode
{
string SimUniqueId {get;set;} // It is mapped with uniqueId of the shape or shape port
/// Other properties
}

This SimUniqueId Property is fixed for the entire application object and it is necessary to set this property.

Now i need to create shape manually from the object of above class and map unique id in shape ports so i am having problem..

Is it possible to update the UniqueId of the NPort class any how???





GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic
1 active, 1 guest, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search