Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Exception in DiagramView.EndEdit (Read 1915 times)
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 136
Location: England
Joined: Oct 23rd, 2006
Exception in DiagramView.EndEdit
Oct 26th, 2009 at 10:33am
Print Post  
Whenever I click on a menu bar or close a form I call the following function:

private void EndBoxEditing()
{
if (EditedBox != null)
diagramView.EndEdit(true);
}

Edited box is set when I click on a node. The code being:

EditedBox = (ShapeNode)e.Node;
diagramView.BeginEdit(EditedBox);

EditedBox is set to null in the flowChart_NodeTextEdited function. This all seems to work 99% of the time but we have just got the following exception that seems to be in Mindfusion code:

HTA Exception at : 26/10/2009 00:25:33
Message : Object reference not set to an instance of an object.
Source : MindFusion.Diagramming.WinForms
Stack Trace :
at MindFusion.Diagramming.WinForms.DiagramView.EndEdit(Boolean accept)
at HierarchicalTaskAnalysis.HTAForm.EndBoxEditing()
at HierarchicalTaskAnalysis.HTAForm.HTAForm_FormClosing(Object sender, FormClosingEventArgs e)
at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Form.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exception in DiagramView.EndEdit
Reply #1 - Oct 26th, 2009 at 11:15am
Print Post  
The control might be ending the edit operation automatically if it loses focus when you click on the menu or close the form. Try to set EditedBox = null in response to the NodeTextEdited event, so that the EndEdit method is not called.
  
Back to top
 
IP Logged
 
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 136
Location: England
Joined: Oct 23rd, 2006
Re: Exception in DiagramView.EndEdit
Reply #2 - Oct 26th, 2009 at 12:26pm
Print Post  
Yes, I do that - I mention it about half-way through my post.  Any other ideas?

DavidL
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exception in DiagramView.EndEdit
Reply #3 - Oct 26th, 2009 at 2:26pm
Print Post  
Are you using a custom editor or the built-in TextBox? Could you add a LeaveInplaceEditMode handler that prints the Item event argument, and check if it was null when the exception happens?
  
Back to top
 
IP Logged
 
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 136
Location: England
Joined: Oct 23rd, 2006
Re: Exception in DiagramView.EndEdit
Reply #4 - Oct 26th, 2009 at 3:01pm
Print Post  
This exception very rarely occurs.  I will just monitor the situation for now and see if it becomes more reproducable.

Thanks for your help.

DavidL
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint