Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic InvalidOperationException (Read 2561 times)
bharath_kolanda
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 18th, 2009
InvalidOperationException
Aug 11th, 2009 at 3:01pm
Print Post  
Hi

I got InvalidOperationException after changing the SizeMode property of DiagramNodes in DiagramNodeCollection. Can anyone help to solve this problem. Here is the code which i used

foreach (DiagramNode node in this.fpidrList[i].Nodes)
{
      BaseNode baseNode = node as BaseNode;
      if (null != baseNode)
         baseNode.SizeMode = this.currMode;                  
}

Regards,
Bharath.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: InvalidOperationException
Reply #1 - Aug 11th, 2009 at 3:07pm
Print Post  
Hi,

This looks like a property of your custom node type. What does it do?

Regards,
Stoyan
  
Back to top
 
IP Logged
 
bharath_kolanda
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 18th, 2009
Re: InvalidOperationException
Reply #2 - Aug 11th, 2009 at 3:19pm
Print Post  
It modifies the AdjustmentHandles of DiagramNode
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: InvalidOperationException
Reply #3 - Aug 11th, 2009 at 5:24pm
Print Post  
Did you mean EnabledHandles or HandleStyle? Isn't there any stack trace shown?
  
Back to top
 
IP Logged
 
bharath_kolanda
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 18th, 2009
Re: InvalidOperationException
Reply #4 - Aug 12th, 2009 at 6:10am
Print Post  
Both EnableHandles and HandleStyle were modified. Below is the StackTrace

Message: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
   at MindFusion.Diagramming.Diagram.x679ae26de3befa07(IGraphics x41347a961b838962, RectangleF xd0772cd9ac472b96, Boolean x979174172ae18db3)
   at MindFusion.Diagramming.Diagram.Draw(IGraphics graphics, RenderOptions options, RectangleF clipRect, Boolean noModifiedItems)
   at MindFusion.Diagramming.WinForms.DiagramView.x45babdc9db40342f(IGraphics x41347a961b838962, RectangleF xd1cff1e8f8666dbe, Boolean x8de543c74cdd4f6e)
   at MindFusion.Diagramming.WinForms.DiagramView.OnPaint(PaintEventArgs pe)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: InvalidOperationException
Reply #5 - Aug 12th, 2009 at 7:09am
Print Post  
Does SizeMode set HandlesStyle to Custom? That exception might be thrown if there are items added to the diagram during custom-draw operations. Check if any custom-draw event handlers you have do that.
« Last Edit: Aug 12th, 2009 at 10:47am by Stoyo »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint