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
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