Code Serialization Inconsistency

Posted by jquerijero on 22-Nov-2016 17:25

What triggers PDS to serialize unmodified custom properties of UserControl and custom Control to the InitializeComponent block? And sometimes it doesn't?

It's a pain when the serialized value of the property becomes out-of-synch with the UserControl.

All Replies

Posted by Matt Baker on 22-Nov-2016 17:34

 
What gets written out is controlled by a combination of the widget itself and the Microsoft .NET code dom serializer.
 
PDSOE doesn’t control it.  The widget designer class (if it has one) and the annotations on its properties control the serialization.
 
The PDSOE portion of the serialization writes the code dom instructions out as ABL syntax.
 
If you’re UserControl class is written as an ABL  class then due to ABL limitations, and the properties that would normally prevent default value serialization are not present as the ABL doesn’t support annotations.
 
 
mattB
 

Posted by Mike Fechner on 23-Nov-2016 00:19

With ABL properties on hybrid user controls, you should not rely on the implicit initial value.
 
DEFINE PUBLIC PROPERTY xyz AS CHARACTER INIT “” .
 
will not be written to the Form’s initializeComponent method when the property’s value is “”. But
 
DEFINE PUBLIC PROPERTY xyz AS CHARACTER.
 
will. So always define an explicit initial value.

Posted by jquerijero on 23-Nov-2016 09:38

My problem is that for the same UserControl, PDSOE sometimes includes and sometimes it doesn't include property initialization in IntializeComponent. I'm wondering what is causing the inconsistency to happen.

Is it the presence of r-code, location of r-code and etc.?

This thread is closed