Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Execution hangs on links operations when using Lanes (Read 1544 times)
Psybeam
YaBB Newbies
*
Offline


It's super effective!

Posts: 2
Joined: Sep 25th, 2012
Execution hangs on links operations when using Lanes
Sep 25th, 2012 at 12:19pm
Print Post  
Greetings.

I wasn't sure if I should have created this topic here or in Bug Reports, so please move it if it doesn't fit here.

I've decided to use Lanes Grid in the C# application I'm working on, but now it freezes on any operation involving links. If I disable the Lanes, the same code works fine. The code on which the application gets stuck is not mine - what hangs the app is internal MindFusion methods.

I.e., if I pause the debugging, I can see that it's stuck at the lines like

m_diagram.Links.Add(m_diagram, ParentNode, Node)

or

m_diagram.RouteAllLinks();

I have looked into the sample Lanes application and have not found any reason why would links work there but do not in my case.

Here's the code I initialize my grid with:

Code
Select All
Grid grid = m_diagram.LaneGrid;
      HeaderCollection columns = grid.ColumnHeaders;

      grid.MinHeaderSize = 50;
      grid.HookHeaders = false;
      grid.HeadersOnTop = false;
      grid.ColumnHeadersHeights = new float[] { 10 };
      grid.AlignCells = false;
      grid.AllowResizeHeaders = false;

      columns.Add(new Header("1"));
      columns.Add(new Header("2"));
      columns.Add(new Header("3"));
      columns.Add(new Header("4"));
      columns.Add(new Header("5"));
      columns.Add(new Header("6"));

      grid.ColumnCount = 6;
      grid.RowCount = 1;

      grid.RowHeaders[0].Style.BackgroundBrush = new SolidBrush( Color.Gainsboro );
      grid.RowHeaders[0].Width = 0;

      for (int i = 0; i < 6; i++)
      {
        Header column = grid.GetColumn(i);

        column.Style.BackgroundBrush = new SolidBrush(Color.Gainsboro);
        column.Style.BottomBorderPen = null;

        column.Style.LeftBorderPen =
          column.Style.TopBorderPen =
            column.Style.RightBorderPen = new Pen(Color.Gainsboro, 0.5f);

        column.TitleFont = new Font( "Tahoma", 9.75f, FontStyle.Bold );

        grid[column, null].Style.BackgroundBrush =
          new SolidBrush(Color.WhiteSmoke);

        grid[column, null].Style.BottomBorderPen =
          grid[column, null].Style.LeftBorderPen =
            grid[column, null].Style.RightBorderPen = new Pen(Color.Gainsboro, 0.5f);

        grid[column, null].Style.TopBorderPen = null;

        if(i == 0)
        {
          grid[column, null].Style.LeftBorderPen = null;
          grid[column, null].Style.BottomBorderPen = null;
        }
      }

      m_diagram.Bounds = new RectangleF(0, 0, 300, Single.NaN);

      m_diagram.EnableLanes = true;
 



Any thoughts?
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Execution hangs on links operations when using Lanes
Reply #1 - Sep 25th, 2012 at 12:51pm
Print Post  
Hi,

NaN values are not supported for Bounds coordinates and in this case the routing algorithm gets confused by this line in your code:

Code
Select All
m_diagram.Bounds = new RectangleF(0, 0, 300, Single.NaN); 



Initialize the rectangle with a number value and routing should work as expected.

I hope this is helpful.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Psybeam
YaBB Newbies
*
Offline


It's super effective!

Posts: 2
Joined: Sep 25th, 2012
Re: Execution hangs on links operations when using Lanes
Reply #2 - Sep 26th, 2012 at 9:57am
Print Post  
That was exactly it! Thank you! Smiley
Issue solved! Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint