how create designer in Visual Studio 2010?

417 views Asked by At

I created an item template that generates a .CS file and adds it to the project. I want to create a DESIGNER that is shown everytime the user tries to open this .CS file from the Solution Explorer, just like XX.EDMX and XX.Dsigner.cs ?

Any ideas? Thanks!!

1

There are 1 answers

1
Zooba On BEST ANSWER

The short answer is given in the VSSDK reference (on MSDN) page on Designer Initialization and Metadata Configuration page (all keywords are linked on the page itself):

A VSPackage should handle designer initialization by:

  1. Creating an object implementing the DesignSurfaceExtension class.

  2. Register the class implementing DesignSurfaceExtension as providing support for the VSPackage's designer extensions by applying instances of DesignSurfaceExtensionAttribute, ProvideObjectAttribute and ProvideServiceAttribute to the class providing the VSPackage's implementation of Package.

Unfortunately the long answer is going to be extremely long, and in the absence of genuinely good documentation, involve a lot of trial and error. A quick search didn't show any complete examples, so if you're willing/able to, it'd be great if you could share what you figure out.