Hi,
Is it possible?
We have some "aesthetic" issues with the links, it's impossible put the thumbs in a good position dragging&dropping:
Is there a way to force the links to honour the grid and honour the borders of the DiagramNodes?
In the other hand, I'm trying to write a method that gets rid of the redundant control points in a link. I mean, sometimes a straight link is splitted in two segments, and the central thumb is close to the final thumb, then the text appears very close to the element, like this:
So I want to execute a function that clean those redundant points every time a link is modified. I've tried:
private void DatabaseDiagram_LinkModified( object sender, LinkEventArgs e )
{
List<Int32> redundantPointsIndex = new List<Int32>();
Point? lastPoint = null;
for(Int32 i=0;i<e.Link.ControlPoints.Count;i++)
{
Point controlPoints = e.Link.ControlPoints[ i ];
if ( lastPoint.HasValue && lastPoint == controlPoints )
redundantPointsIndex.Add( i);
lastPoint = controlPoints;
}
foreach ( Int32 p in redundantPointsIndex.OrderBy( i => i ) )
{
e.Link.ControlPoints.RemoveAt( p );
// Problem: SegmentCount never changes...
e.Link.SegmentCount = (Int16)(e.Link.SegmentCount - 1);
}
e.Link.UpdateFromPoints();
e.Link.AutoRoute = true;
}
And the links appears correctly after execute that code over the link, but when I save and retrieve the link appears again bad. I think is because I cannot modify the segment count property. I've checked in debug mode, and no matters what value I substract from SegmentCount, it remains always in the same value. What is the best way to accomplish this?
Cheers.