Click here to Skip to main content
15,916,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: Network in C#: how to detect that I have a break connection Pin
Heath Stewart20-Oct-04 16:36
protectorHeath Stewart20-Oct-04 16:36 
QuestionRegional parameters : how to change the langage of the system ? Pin
youssef20-Oct-04 12:24
youssef20-Oct-04 12:24 
AnswerRe: Regional parameters : how to change the langage of the system ? Pin
Nick Parker20-Oct-04 16:51
protectorNick Parker20-Oct-04 16:51 
GeneralVery Simple question Pin
ben220-Oct-04 11:52
ben220-Oct-04 11:52 
GeneralRe: Very Simple question Pin
Dave Kreskowiak20-Oct-04 12:24
mveDave Kreskowiak20-Oct-04 12:24 
GeneralUser Control Arrow Keys Not Being detected Pin
R2B220-Oct-04 11:22
R2B220-Oct-04 11:22 
GeneralProblem with designer and custom UI editor Pin
object8820-Oct-04 9:52
object8820-Oct-04 9:52 
GeneralRe: Problem with designer and custom UI editor Pin
Heath Stewart20-Oct-04 10:12
protectorHeath Stewart20-Oct-04 10:12 
object88 wrote:
This is the first time I've worked with designers and customizing designer behavior, so please, any tips are welcome, no matter how simple.

You've obviously done your research. Smile | :)

While it may not make a difference, be sure that you're calling GetService on the IServiceProvider instance passed to your UITypeEditor.EditValue override, and get the IWindowsFormsEditorService in order to call ShowDialog to open your form. That ensures that your dialog is parented properly with the designer and may trigger the results you're looking for. I haven't spent a lot of time in this area of the component designer IL (which you can view with ildasm.exe straight from the SDK, or use a decompiler like .NET Reflector), so I'm not totally sure.

Typically when you want to edit "sub-options", one would either extend ExpandableObjectConverter or just derive from TypeConverter and implement the GetProperties and GetPropertiesSupported. In this case - if you're using a struct - you'll also want to implement CreateInstance and GetCreateInstanceSupported so that you're struct gets recreated the CodeDomSerializer picks up the change.

I'm guess that in your case, such a simple option editor isn't desireable. It would seem that the problem is that the serializer isn't signaling to the designer host (VS.NET) that the file has changed. You may want to query for the IComponentChangeService (as you should with the IWindowsFormsEditorService as I mentioned above) and call OnComponentChanged with the necessary parameters when you're finished. This will signal the designer host that your component has changed (or perhaps that a single property has changed, depending on how you call OnComponentChanged) and it should then serialize your code correctly.

The specially named ShouldSerializerPropertyNames are really for when non-default values are assigned to a property. It really wasn't designed for changes in the component model like this.

HTH

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: Problem with designer and custom UI editor Pin
object8820-Oct-04 10:35
object8820-Oct-04 10:35 
GeneralRe: Problem with designer and custom UI editor Pin
object8820-Oct-04 11:07
object8820-Oct-04 11:07 
GeneralRe: Problem with designer and custom UI editor Pin
Heath Stewart20-Oct-04 13:33
protectorHeath Stewart20-Oct-04 13:33 
GeneralRe: Problem with designer and custom UI editor Pin
Heath Stewart20-Oct-04 13:34
protectorHeath Stewart20-Oct-04 13:34 
GeneralConfigurationSettings.AppSettings Pin
Guillermo Jimenez20-Oct-04 5:50
Guillermo Jimenez20-Oct-04 5:50 
GeneralRe: ConfigurationSettings.AppSettings Pin
Guillermo Jimenez20-Oct-04 5:51
Guillermo Jimenez20-Oct-04 5:51 
GeneralRe: ConfigurationSettings.AppSettings Pin
Heath Stewart20-Oct-04 6:18
protectorHeath Stewart20-Oct-04 6:18 
GeneralGDI+ drawing onto picturebox Pin
xiaowenjie20-Oct-04 5:39
xiaowenjie20-Oct-04 5:39 
GeneralRe: GDI+ drawing onto picturebox Pin
Heath Stewart20-Oct-04 6:50
protectorHeath Stewart20-Oct-04 6:50 
GeneralRe: GDI+ drawing onto picturebox Pin
xiaowenjie20-Oct-04 7:47
xiaowenjie20-Oct-04 7:47 
GeneralRe: GDI+ drawing onto picturebox Pin
Not Active20-Oct-04 10:16
mentorNot Active20-Oct-04 10:16 
GeneralRe: GDI+ drawing onto picturebox Pin
McClamm20-Oct-04 7:03
McClamm20-Oct-04 7:03 
GeneralRe: GDI+ drawing onto picturebox Pin
xiaowenjie20-Oct-04 7:49
xiaowenjie20-Oct-04 7:49 
GeneralRe: GDI+ drawing onto picturebox Pin
Heath Stewart20-Oct-04 9:51
protectorHeath Stewart20-Oct-04 9:51 
Generalderivation question Pin
3Dizard20-Oct-04 5:33
3Dizard20-Oct-04 5:33 
GeneralRe: derivation question Pin
Heath Stewart20-Oct-04 6:32
protectorHeath Stewart20-Oct-04 6:32 
GeneralRe: derivation question Pin
J4amieC20-Oct-04 22:41
J4amieC20-Oct-04 22:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.