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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DockingManager.LoadDockState() doesn''t load the state from MemoryStream

Thread ID:

Created:

Updated:

Platform:

Replies:

46266 Jul 10,2006 11:16 AM UTC Jul 12,2006 10:48 AM UTC Windows Forms 2
loading
Tags: Tools
Administrator [Syncfusion]
Asked On July 10, 2006 11:16 AM UTC

There is the problem with DockingManager. I have а string contating DockingState in XML, made ealier by DockingManager.SaveDockState() method. Now I want set that dockingState to my dockingManager in SerializeMode.XMLFmtStream mode. So, I write: --------------- public void SetDockingState(string xmlDockingState) { byte [] bArray = new UTF8Encoding(true).GetBytes(xmlDockingState); MemoryStream stream = new MemoryStream(); stream.Write(bArray, 0, bArray.Length); AppStateSerializer aser = new AppStateSerializer(SerializeMode.XMLFmtStream, stream); this.dockingManager.LoadDockState(aser); } --------------- But this code does nothing. xmlDockingState is correct XML, because I wrote it to file and then loaded it in SerializeMode.XMLFile mode - it''s work!

Murugan [Syncfusion]
Replied On July 11, 2006 06:37 PM UTC

Hi Lev, When dock state is written into a stream, the position of the stream will be at the end. When AppStateSerializer reads the position, being at end, the docking state is not loaded. After writing the stream we have set the stream position to 0 to load the dock state correctly. public void SetDockingState( string xmlDockingState ) { byte [] bArray = new UTF8Encoding(true).GetBytes(xmlDockingState); MemoryStream stream = new MemoryStream(); stream.Write(bArray, 0, bArray.Length); stream.Position = 0; AppStateSerializer aser = new AppStateSerializer(SerializeMode.XMLFmtStream, stream); this.dockingManager1.LoadDockState(aser); } I have attached a sample.Please go through that and let me know if you need more assistance. Thanks for your interest on Syncfusion products. Regards, Murugan PS

Docking_XML.zip

Administrator [Syncfusion]
Replied On July 12, 2006 10:48 AM UTC

> stream.Position = 0; It really works :) Thanks a lot!

CONFIRMATION

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.

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

;