locked
OutOfMemoryException when Dragging RRS feed

  • Question

  • Hi all,

    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?

    Thanks Jaspis

    Monday, March 2, 2009 9:56 AM

Answers

  • Jaspis,

    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.

    Thanks,
    Lev
    Lev Nachmanson
    Monday, March 2, 2009 7:13 PM

All replies

  • Jaspis,

    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.

    Thanks,
    Lev
    Lev Nachmanson
    Monday, March 2, 2009 7:13 PM
  • Hi 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.

    StackTrace =>
       bei System.ThrowHelper.ThrowKeyNotFoundException()
       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
    StackTrace =>
       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)

    Thanks Jaspis
    Tuesday, March 3, 2009 1:24 PM