Canceling a connection between two shapes.


Author
Message
Yeejun Choi
Yeejun Choi
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)
Group: Forum Members
Posts: 2, Visits: 1
We can cancel a connection between two shapes through the Connecting event.

example :

void EventSinkService_Connecting(NConnectionCancelEventArgs args)
{
try
{
var plug = args.Document.GetElementFromUniqueId(args.UniqueId1) as NPlug;
var port = args.Document.GetElementFromUniqueId(args.UniqueId2) as NRotatedBoundsPort;
var connector = plug.Shape as NShape;

if (port.Plugs != null && port.Plugs.Count == 1)
{
args.Cancel = true;
}
}
catch (Exception error)
{
throw error;
}
}

According to things I've got, UniqueId1 is UniqueId of connection plug. And UniqueId2 is a connected port's.
So a shape of plug(UniqueId1) is NLineShape or NBezierCurveShape or NStepConnector.

Anyway, If args.Cancel is set to true, the connection will be cancelled.
However, something is different in appearance.

In case of dragging edges of line, a connection will be cancelled. But, seemingly it just seems to be connected.

How to move a point of connected line?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search