We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DockingManager LoadDockState problem

Thread ID:





36529 Nov 2,2005 08:10 AM UTC Nov 2,2005 09:59 AM UTC WinForms 1
Tags: Tools
Radoslav Mihaylov
Asked On November 2, 2005 08:10 AM UTC

Hi, I encountered a problem with DockingManager while trying to use SaveDockState and LoadDockState metods with external stream. In SaveDockState method everithing is OK and the stream is full with docking state data, but when I call the LoadDockState to deserialize the docking state nothig happens .. and the LoadDockState returns a false. As an example a piece of code is given: System.IO.Stream stream = new System.IO.MemoryStream(); AppStateSerializer serializer = new AppStateSerializer(SerializeMode.BinaryFmtStream, stream); this.dockingManager.SaveDockState(serializer); serializer.PersistNow(); memento.Stream = stream; ... System.IO.Stream stream = memento.Stream; AppStateSerializer serializer = new AppStateSerializer(SerializeMode.BinaryFmtStream, stream); bool r = this.dockingManager.LoadDockState(serializer); Any ideas? Radoslav Mihaylov, Radslav

Vijayanand S [Syncfusion]
Replied On November 2, 2005 09:59 AM UTC

Hi Radslav, AppStateSerializer does write information into the memory stream correctly. But you need to reset the memory stream’s current position to the beginning or to the point from which the serialized bytes begin before passing it to the AppStateSerializer or calling the LoadDockState method. The AppStateSerializer will have no concept of where the stream begins or ends and it is up to the application to manage the stream. Assuming that this particular stream has just the persisted state information, then setting it’s current position to 0 before calling LoadDockState() will make it work correctly (as shown in the code snippet below) : // loading dock state information this.memstream.Position = 0; AppStateSerializer aser = new AppStateSerializer(SerializeMode.BinaryFmtStream, memstream); this.dockingManager1.LoadDockState(aser); // saving dock state information this.memstream = new MemoryStream(); AppStateSerializer aser = new AppStateSerializer(SerializeMode.BinaryFmtStream, memstream); this.dockingManager1.SaveDockState(aser); aser.PersistNow(); Please refer to the complete sample attached here which illustrates the above, and let me know if you need further assistance. We appreciate your interest in Syncfusion products. Regards, Vijay


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon