|
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?
|