Monday, March 02, 2009 9:56 AM
I have a graph inside a GViewer object.
I can drag the nodes and edges. But how can I define some kind of border for the dragging? Now, I can drag the items so far as I like. The graph gets more and more smaller and sometime the
programm crashes with an OutOfMemoryException.
How can I avoid this?
Monday, March 02, 2009 7:13 PMOwnerJaspis,
I think it is a bug, but can you try to subscribe to the mouse move event and see if you can cancel the event if the graph is becoming too big? I am not sure if it works but it is definitely is worth trying.
- Marked As Answer by Lev NachmansonOwner Sunday, June 19, 2011 7:28 PM
Tuesday, March 03, 2009 1:24 PMHi Lev,
I can fetch the MouseMove Event. In the eventhandler I call the GViewer.Undo() method. This works basically.
But when I drag and undo a couple of times, a System.Collections.Generic.KeyNotFoundException is raised when I click on the graph.
bei System.Collections.Generic.Dictionary`2.get_Item(TKey key)
bei Microsoft.Msagl.Drawing.UndoRedoAction.GetRestoreData(GeometryObject msaglObject)
bei Microsoft.Msagl.Drawing.GeometryGraphEditor.Drag(Point delta)
bei Microsoft.Msagl.Drawing.DrawingLayoutEditor.viewer_MouseMove(Object sender, MsaglMouseEventArgs e)
bei System.EventHandler`1.Invoke(Object sender, TEventArgs e)
bei Microsoft.Msagl.GraphViewerGdi.GViewer.RaiseMouseMoveEvent(MsaglMouseEventArgs iArgs)
bei Microsoft.Msagl.GraphViewerGdi.DrawingPanel.OnMouseMove(MouseEventArgs args)
Do you have an idea?
Another problem: Sometimes when you drag a node and release the mouse button a NullReferenceException is raised:
Type => System.NullReferenceException
bei Microsoft.Msagl.Drawing.GeometryGraphEditor.OnDragEnd(Point delta)
bei Microsoft.Msagl.Drawing.DrawingLayoutEditor.viewer_MouseUp(Object sender, MsaglMouseEventArgs args)
bei Microsoft.Msagl.GraphViewerGdi.GViewer.RaiseMouseUpEvent(MsaglMouseEventArgs iArgs)
bei Microsoft.Msagl.GraphViewerGdi.DrawingPanel.OnMouseUp(MouseEventArgs args)