I pretty much came to the same conclusion as you in the 2nd paragraph.
My ExtenderProvider allows a control to have multiple Text properties
(with an additional TextItems property) that can be switched between at
runtime via a SelectedIndex property. Rather than make the existing Text
property redundant, I modified the design so that the existing Text
property acts as the first of the alternate text strings and only the
additional items are in the new property. This seems to work more
smoothly
Thanks for the input
Andrew
-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of J. Merrill
Sent: Wednesday, November 30, 2005 10:31 AM
To: [email protected]
Subject: Re: [ADVANCED-DOTNET] More ExtenderProvider tricks needed
I haven't done this, but I think you could likely accomplish this by
setting the DefaultValue attribute of the control you're extending to
the string you're causing to be displayed. When the default value
matches the current value, nothing gets serialized to the .resx file (or
to the code).
Given that I don't know what kind of control you're extending, I wonder
if it make more sense to implement a new property that's displayed at
design time, rather than stomping on the extended control's Text
property. Unless you've done something to prevent the user from
changing the Text of the extended control, what you're doing could cause
confusion when you overwrite that value with your value.
At 10:35 AM 11/29/2005, Eames, Andrew wrote
>My ExtenderProvider has a side effect of setting the "Text" property of
>the control that it extends. However this is really only for display
>purposes at design time and I don't want the Text property to be
>serialized out to the .resx file. Anyone got any ideas as to how I
could
>best achieve this?
> Andrew
J. Merrill / Analytical Software Corp
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com