BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Wayne,
Thanks for using Syncfusion products.
We suggest you to use the Diagram.Model.EventSink’s ‘ConnectionChanged’
event to check whether the connections have been present the nodes or not.
Please refer the below code snippet to achieve your requirement.
Here is the code:
[C#]
void
EventSink_ConnectionsChanged(CollectionExEventArgs
evtArgs)
{
if
(evtArgs.ChangeType == CollectionExChangeType.Insert)
{
if
(evtArgs.Element is EndPoint)
{
ConnectorBase
conn = ((EndPoint)evtArgs.Element).Container
as ConnectorBase;
if
(conn != null)
{
if (conn.FromNode != null
&& conn.ToNode != null)
{
Node toNode = conn.ToNode as
Node;
foreach (ConnectorBase
nodeConns in conn.ToNode.Edges)
{
if (((nodeConns.FromNode == conn.FromNode && nodeConns.ToNode
== conn.ToNode) ||
(nodeConns.FromNode == conn.ToNode && nodeConns.ToNode ==
conn.FromNode)) && conn != nodeConns)
{
evtArgs.Cancel = true;
diagram1.Model.RemoveChild(conn);
break;
}
}
}
}
}
}
}
Here is the sample:
http://www.syncfusion.com/downloads/Support/DirectTrac/105295/F107516-1585009003.zip
Please let us know if you have any queries.
Regards,
Amsath Ali. M