How to use XmlDockingWindow?

Posted 1 month ago by Avatar rex hui

If I don't want the LastActiveDateTime to be saved to the xml file during serialization, I assume I should create a class derived from XmlDockingWindow and override ShouldSerializeLastActiveDateTime to return false. Correct?

But how to connect this class to the DockSiteLayoutSerializer?


Comments (4)

Posted 30 days ago by Actipro Software Support - Cleveland, OH, USA


Out of curiosity, why wouldn't you want that serialized?  It tracks the order the windows were used so that as something closes, it knows what was last used.

You could probably attach to the DockSiteLayoutSerializer.ObjectSerialized event and in the handler, if the e.Node is a XmlDockingWindow, set its LastActiveDateTime to DateTime.MinValue.

Actipro Software Support
Posted 30 days ago by rex hui

Thanks but that is not utilizing the ShouldSerializeLastActiveDateTime?

The reason is that we don't want to save the file if nothing is changed. The LastActiveDateTime will be changed each time even if the windows order are the same.

Posted 29 days ago by Actipro Software Support - Cleveland, OH, USA

ShouldSerializeLastActiveDateTime is effectively seeing if the date is not MinValue.  That's why I suggested you just set the MinValue to get ShouldSerializeLastActiveDateTime to return false.

Actipro Software Support
Posted 29 days ago by rex hui

Ok thank you!

Information The latest build of this product (2018.1 build 0670) was released 7 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.