Here I come again with this question. I posted this in
many forums and nobody gave an answer. Maybe there is no
answer?
So here goes: I use a custom CodeDomSerializer to add
serialization to some members of a colection member of a
custom control. One of these members is an Image Type. I
use SerializeResource to actualy store the image and
SerializeToExpression to create the deserialization code.
It all works out fine *as long as* the ResourceManager
object (resources) is already created on the parent form.
This is the same object that gets created when you change
the backgroundImage of the form. I did some reflection in
the assemblies and I found out an internal class called
SerializeResourceManager that seems to be doing this job
(of checking if the ResourceManager object exists and if
not create it).
So the question is, from inside the CodeDomSerializer of
a custom control, how can I access and check if the
ResourceManager object exists as a member of the parent
form and if not to create it? Do I need to access the
DesignerHost? Anybody has any idea?
Thank you!!