We use DesignSurface and all that is good good quality IDesignerHost in our own designer. Then the developed forms are saved in our own individual format, and all this works fine. We also want to export the forms in text format (which we did since it is not so difficult).
However, we also want to import this text back into the document for the designer, which includes returning the designer code to CodeCompileUnit. Unfortunately, the Parse method is not implemented (no doubt, good reasons). Is there an alternative? We do not want to use anything that would not be on a standard .NET installation (for example, .NET libraries installed in Visual Studio).
My current idea is to compile the imported text and then instantiate the form and copy its properties and controls onto the project surface object and just grab the new CodeCompileUnit, but I was hoping there was a better way. Thanks.
UPDATE: I, although some may be interested in our progress. So far, not so good. A brief overview of what I found is that the Parse method was not implemented because it was considered too complicated, there are open source parsers that do this work, but they are not complete and therefore not guaranteed to work in all cases (I believe that NRefactory is one of the projects of the SharpDevelop project), and copying controls from instance to designer does not work yet. I believe that this is due to the fact that although the controls are added to the instance of the form that covers the surface of the designer, the surface of the designer is not aware of their inclusion. Our next attempt is to simulate cut / paste to seeDoes this allow it. Obviously, this is a huge unpleasant workaround, but we need it to work, so we will take a hit and watch for alternatives.