Wizard Generated code and regions

Hello folks,

I know this is answered somewhere here. Just can't find it so I'm sorry for asking this simplistic question.

When working with wizard generated code where does one specify the #region that the code should be entered into.

I'm finding it most annoying that the generated code is always ending up in my main class view window and cluttering it up.

Thanks for any ideas folks...



Answer this question

Wizard Generated code and regions

  • Teastrone

    I'll pass your comments to the people who own the dataset generators.

  • CO22006

    Is this a project that you created via the wizard in VS2005, manually in VS2005, or was it an upgraded project

    For Vs2005 projects, the designer code should be hidden inside the formx.designer.vb file (you need to show all files for it to show up). If you don't have the file, or if you changed the location of the InitializeComponent method, then the code will be generated wherever that method happens to be.

    Best Regards,



  • Kirankrb

    Hi Rod,

    through the IDE, you can change the namespace in which the code will be generated. To do so, simply select the .xsd project item in the Solution Explorer window and there should be a Custom Tool Namespace property showing in the Properties window. There doesn't seem to be a way to specify the #region though. What option in xsd.exe did you use to do this

    HTH

    Antoine
    Microsoft Visual Studio Team

  • dakerson

    I'm sorry. I should have included more details.

    It is when I'm generating strongly typed datasets within the IDE using C#. I know that I can specify the #region if I use the command line utility XSD. I'm using that now but it obviously is not as convienent as from within the IDE.

    It is just that it seems if the the VS 2005 team knew that with XSD we would want to specify what #region we would like the generated code put in - that there would be some way to specify same from the IDE

    Thanks very much


  • Mark Benningfield

    Hi Antoine,

    Yesterday (and today as well) is a good indication as to why we shouldn’t work when we have cold chills and headaches.

    For some inexplicable reason I was fixated on #regions when I was indeed thinking namespaces.

    Though it would be nice to be able to inject into #regions in some instances you did in fact answer my question.

    Now to clear up any confusion – I haven’t found a secret command line switch for XSD that allows one to specify #region.

    It was indeed namespace that I meant in my flu induced state.

    So thanks very much for pointing out how this is done form within the IDE.

    Thanks to everyone here. What a helpful community! Thanks so much

    Now I'm taking a few days off.

    Rod


  • Wizard Generated code and regions