M
Mark Olbert
Flame on.
I am SICK and TIRED of the incredibly LOUSY documentation that Microsoft provides for creating
custom components.
Here's my situation:
I've implemented a custom CodeDomSerializer class to handle serialization of my component's state to
and from the InitializeComponent() method.
It was working fine. I could tweak the component's configuration and have the changes persisted to
code, and then when I reopened the project later the changes were deserialized properly. I did this
many, many times, admittedly partially because I thought the process was, well, cool!
But that was yesterday.
Today the deserialization is not taking place (the debugger does not break in the derserialization
method (it did yesterday).
I do not have a custom deserialization method; all I do is call the base class deserialization
method. Yet serialization is working fine -- I've created a fresh new instance of the component,
configured it, and watched it use the custom serializer to persist information to code.
I'm sure there's some simple, but not obvious, reason why what worked yesterday does not work today.
And I'm pretty darn sure, but not absolutely certain, it's something I did.
But what makes me flaming angry mad is IT SHOULD NOT BE POSSIBLE FOR A PROCESS TO WORK ONE DAY AND
FAIL THE NEXT WITHOUT SOME KIND OF ERROR MESSAGE!!!!!!!!
That's just basic good program design. Then again, I've often felt that Microsoft doesn't really
understand good program design. "Ship sh*t and fix it later", as Ballmer's been quoted as saying
(well, I translated what he said publicly, but that was the gist of it). Fortunately for them, and
unfortunately for the rest of us, monopolies can get away with that kind of customer insensitvity.
Flame off.
Now... suggestions on how to diagnose and attack this problem would be much appreicated.
Here's what little I've been able to glean by scattering breakpoints around my code:
When I open a designer for a dervied custom component in a test application, the
InitializeComponent() method of the base custom component runs. Of course, since all the slick
persistence is in the InitializeComponent() method of the derived component class the derived
component is unconfigured.
The OnLoad method of my custom designer runs. I use a UserControl, returned by the GetView()
implementation of the ComponentDocumentDesigner for my component, as the design surface. Yesterday,
the component that the design surface represented was fully initialized by ths point. Today it
isn't.
The InitializeComponent() method of the derived component class runs. After this step, of course,
the derived component has "deserialized" the state information that was persisted in the source code
(although, for some reason, the Deserialize() method of the custom CodeDomSerializer class never
gets entered). Unfortunately, this state information was deserialized too late to initialize the
design surface.
If anyone knows of an example of using a custom design surface for a custom component that I could
study I'd really appreciate it.
And Microsoft... get your act together, and DOCUMENT SOME OF THIS STUFF!!!!!!!!!!!!!!!!!!! You might
even throw in a few examples.
- Mark
I am SICK and TIRED of the incredibly LOUSY documentation that Microsoft provides for creating
custom components.
Here's my situation:
I've implemented a custom CodeDomSerializer class to handle serialization of my component's state to
and from the InitializeComponent() method.
It was working fine. I could tweak the component's configuration and have the changes persisted to
code, and then when I reopened the project later the changes were deserialized properly. I did this
many, many times, admittedly partially because I thought the process was, well, cool!
But that was yesterday.
Today the deserialization is not taking place (the debugger does not break in the derserialization
method (it did yesterday).
I do not have a custom deserialization method; all I do is call the base class deserialization
method. Yet serialization is working fine -- I've created a fresh new instance of the component,
configured it, and watched it use the custom serializer to persist information to code.
I'm sure there's some simple, but not obvious, reason why what worked yesterday does not work today.
And I'm pretty darn sure, but not absolutely certain, it's something I did.
But what makes me flaming angry mad is IT SHOULD NOT BE POSSIBLE FOR A PROCESS TO WORK ONE DAY AND
FAIL THE NEXT WITHOUT SOME KIND OF ERROR MESSAGE!!!!!!!!
That's just basic good program design. Then again, I've often felt that Microsoft doesn't really
understand good program design. "Ship sh*t and fix it later", as Ballmer's been quoted as saying
(well, I translated what he said publicly, but that was the gist of it). Fortunately for them, and
unfortunately for the rest of us, monopolies can get away with that kind of customer insensitvity.
Flame off.
Now... suggestions on how to diagnose and attack this problem would be much appreicated.
Here's what little I've been able to glean by scattering breakpoints around my code:
When I open a designer for a dervied custom component in a test application, the
InitializeComponent() method of the base custom component runs. Of course, since all the slick
persistence is in the InitializeComponent() method of the derived component class the derived
component is unconfigured.
The OnLoad method of my custom designer runs. I use a UserControl, returned by the GetView()
implementation of the ComponentDocumentDesigner for my component, as the design surface. Yesterday,
the component that the design surface represented was fully initialized by ths point. Today it
isn't.
The InitializeComponent() method of the derived component class runs. After this step, of course,
the derived component has "deserialized" the state information that was persisted in the source code
(although, for some reason, the Deserialize() method of the custom CodeDomSerializer class never
gets entered). Unfortunately, this state information was deserialized too late to initialize the
design surface.
If anyone knows of an example of using a custom design surface for a custom component that I could
study I'd really appreciate it.
And Microsoft... get your act together, and DOCUMENT SOME OF THIS STUFF!!!!!!!!!!!!!!!!!!! You might
even throw in a few examples.
- Mark