is it possible to override default designer functionality specifically, i want to change how the designer responds to double-clicking on events in the property editor. instead of placing the event handler into the codebeside, i want to place it into a different file. is this possible

overriding default designer functionality
StefanS
Again, be careful to test deserialization (what we call when you open an existing designer and it reads state from code). Your change may disconnect the designer from its events, so the user may not know what events are set. If this is ok with you, then thats up to you -- but be careful about shipping this to users that still expect this functionality to work.
VSIP samples can be found in the VS SDK:
http://www.vsipmembers.com/partner/DownloadFiles.aspx
Graham Harrison
Hi ben,
I have read in Your answer about VSIP samples.
I'm interesting in this topic, so could You tell me where can I find this code samples
Thanks
Operator10
Hi Alex,
Have You tried the suggestion for writing code in another source file
Is it possible
If yes, Could You give me any information
Thank you
Felice Russo
Bob McD
No, I would not recommend this. At best, this is very difficult to do, if not impossible. The designer loads "docdata" only for the immediate file and any child files. It has no knowledge of other files -- so (for example) the event binding done in the IEventBindingService would have to be customized.
If you wanted to go down this path, I would start by wrapping and replace the IEventBindingService and then also wrap the PropertyDescriptor returned by GetEventProperty. This descriptor is used to get the underlying method that an event is bound to. This might get you started at least.
Also, take a look at "CodeModel". This is an object model that the background compilers produce for a project. Look at some VSIP samples for CodeElement and CodeClass (for example). If you do this, you should use this object model to create the new method.
-Ben
Jon D.
well i have a whole structure in place to support that. i needed to be able to have inheritence in codebehinds, which doesn't work well out of the box. what i end up doing is making a codebehind for the codebehind - a class that has all the same members as the codebehind (all the ui elements) that get populated from the target ascx OnInit. then i can attach to event handlers in that class rather than in the codebehind directly.
with that model in place, it's fairly trivial to catch a change in the codebehind and move it to my class, but i haven't spent the time to do it.
Steve Nunez
i'm familiar with the code model, but i was more concerned with not having the event handler stub show up in code-behind. however, i can probably try to watch the codebehind and simply relocate the new method whenever it is created...
thanks.