Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem creating links programatically (Read 1372 times)
vtortola
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 104
Joined: Nov 26th, 2008
Problem creating links programatically
Mar 6th, 2009 at 5:57pm
Print Post  
Hi,

I was creating links programatically and every time I added one, I arranged the nodes with an automatica layout.

http://mindfusion.eu/Forum/YaBB.pl?board=wpfdg_disc;action=display;num=123262812...

Now I have to apply the layout only on demand, so now I only create the link programatically without apply the layout... and the link appears far from the nodes... It's strange because when I move each node the link moves as well... so are definitely linked:



When I apply the layout then the link appears correctly.

I'm creating the link in this way:

TableNode tableNodeFrom = GetTableNodeFromTableName( rel.TableFrom );
TableNode tableNodeTo = GetTableNodeFromTableName( rel.TableTo );

if ( tableNodeFrom != null && tableNodeTo != null )
{
DiagramLink l= DatabaseDiagram.Factory.CreateDiagramLink( tableNodeFrom, tableNodeTo );
l.Tag = rel;
l.Font = _linkFont;
l.ToolTip = rel.FkColumn;
l.Text = rel.FkColumn;
l.TextBrush = _linkTextBrush;
}


Do you have any idea about what may be the problem?

Cheers.
  
Back to top
 
IP Logged
 
vtortola
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 104
Joined: Nov 26th, 2008
Re: Problem creating links programatically
Reply #1 - Mar 6th, 2009 at 6:43pm
Print Post  
Humm... seems that I've fixed it using:

l.ReassignAnchorPoints();

in the code.

Happy days then  8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint