Question

How to use XmlDockingWindow?

Posted 3 months 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?

Thanks.


Comments (4)

Posted 3 months ago by Actipro Software Support - Cleveland, OH, USA

Hello,

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 3 months 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 3 months 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 3 months ago by rex hui

Ok thank you!

Information The latest build of this product (2018.1 build 0671) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.