Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
680
Problem with removing workspaces
posted

Hello,

 I am using the UltraDockManager but I'm having a small problem with removing workspaces. I support multiple layouts in my application which makes me want to be able to save and unload the information available in the docking manager to load it with new information. I found that upon closing a workspace it gets status hidden, but doesn't get removed from the DockManager. This is impracticle, because I don't want extra information in my dock manager when I save it.

To resolve the issue I added a listener to PropertyChanged in DockableControlPane and made this.Control.Dispose() followed by this.Dispose if  propId == PropertyIds.Closed. This actually worked according to my needs, until I ran my unit test which threw an exception at the this.Control.Dispose(). Do you have any tips on how to get the workspace dissappear from my manager without making my unit test fail? The exception was a NullReferenceException, the stack trace follows:

   at Infragistics.Win.UltraWinDock.UltraDockManager.DestroyControl(Control control)
   at Infragistics.Win.UltraWinDock.UltraDockManager.RemoveControlPaneContainer(DockableControlPane pane)
   at Infragistics.Win.UltraWinDock.UltraDockManager.ControlPaneRemoved(DockableControlPane pane)
   at Infragistics.Win.UltraWinDock.DockableControlPanesCollection.Remove(DockableControlPane pane)
   at Infragistics.Win.UltraWinDock.DockableControlPane.OnControlDisposed(Object sender, EventArgs e)
   at System.ComponentModel.Component.Dispose(Boolean disposing)
   at System.Windows.Forms.Control.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at <some namespace>.PropertyChanged(PropertyIds propId)

 

Parents Reply Children
No Data