SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Compact Framework Modification to winforms designer

Last post 10-05-2008 11:55 PM by s369610. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-04-2008 10:38 AM

    Compact Framework Modification to winforms designer

    I am looking to develop a modification to the winforms designer addin that would allow me to prevent the designer from generating code incompatible with the .NET Compact Framework. In the first prototype it would just be a filter on what is written to the form designer section of the code, where would the best place in the source code be to place this filter. I had a look and found a few candidates but I am mostly unfamiliar with the source code and am after a hint of where is the CORRECT or EASIEST place to put this filter.

     Thanks guys.

    David

    (I'll be damned if I buy the PRO version of visual studio just to develop .netcf apps! #develop for ever!)

  • 10-04-2008 1:14 PM In reply to

    Re: Compact Framework Modification to winforms designer

    I would suggest placing this filter in AbstractDesignerGenerator.MergeFormChanges, and it probably should be called just before the call to FixGeneratedCode(...). The local variable "initializeComponent" contains the generated code in CodeDom format. You should be able to iterate through all the statements of the method body and remove unsupported ones.

    Theoretically you could even make use of the DOM of SharpDevelop to find out dynamically which classes and methods are missing in the context of the current project. That would be the most universal solution.

    Christian

  • 10-05-2008 11:55 PM In reply to

    Re: Compact Framework Modification to winforms designer

    thanks for the tips!

    I managed to get it working, but the sharpdevelop dom checking needed to be done after the codedom had been commited to the source file, otherwise my checker would remove all properties and events for newly added components. I ended up refactoring the section of code which replaces the initialize component method into its own private function, let the mergeformchanges flow once, then at the end run my filter and replace the initialize component method with the new changes.

    Seems to be working fine, though still feels like such a dirty hack. I wonder how VS does it.

      

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.