Setting Control Properties with a Control Builder

P

Peter O'Connell

I have a control that requires a custom ControlBuilder to parse certain
child tags as controls, but I also want to use other tags to set properties.
Is this possible?

The default ControlBuilder, combined with the ParseChildren(true) attribute,
will automatically assign child tags to corresponding properties of the
control. But I need to set ParseChildren(false) in order for the my
ControlBuilder to be invoked.

I can detect all relevant tags in the overridden GetChildControlType and
AppendSubBuilder methods - but I can find no way to assign that information
to the control's property.

I know I can accomplish something similar by overriding the
AddParsedSubObject() method on the control itself -- but I want a solution
that works during parsing, not run-time.

Here's a simplified version of the structure I need to parse:

<MyControl>
<MyProperty>some value</MyProperty>
<MyChildControl></MyChildControl>
</MyControl>


If anyone has any specific suggestions for my scenario or pointers to useful
documentation about ControlBuilders I would be very grateful. I have
searched Google and MSDN extensively and found no good information on how
ControlBuilders work beyond trivial examples

I have even reviewed the source for .Net's ControlBuilders and learned only
that most of the methods that looked interesting are private.

Thanks,
Pete
 
P

Peter O'Connell

Will someone from Microsoft please confirm or deny the fact that this is one
of the newsgroups where Microsoft has "A commitment to respond to your post
within two business days." I just got off the phone with MSDN customer
support and they didn't seem to know.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top