|
|
Attenzione!Sembra che un programma di rimozione della pubblicità come AdBlock sia attivo. CoolSoft si accontenta di un paio di banner non fastidiosi e nessun popup. Grazie per l'aiuto. |
![]() |
DeCodEx
DeCodEx stands for Designer Code Extractor.
If you are using the new .NET Framework 2.0, I hope you know about the existance of Partial Types.
Partial types allows you to split the definition and implementation of a class or a struct across multiple files.
You can put one part of a class in one file and another part of the class in a different file by using the new partial keyword
VisualStudio 2005/2008 itself uses partial types to manage Form and UserControl sources, separing Designer code from User code.
This is a better solution, if compared with the old #Region...#End Region used in VisualStudio 2002/2003.
OK, we all agree on this but... have you ever tried to convert a .NET 1.1 project to 2.0?
The conversion usually completes smootly, depending on how well was the old code written (VS2005 is more meticolous regarding type-conversions and Object usage).
Anyway, during the conversion, Forms and UserControls are not splitted to the new (so called) Designer+User format.
Since I was tired having all of my user code mixed with VisualStudio one, I created DeCodEx to split an old-style source file into User+Designer partial files.
Splitting is accomplished by moving regions, fields and methods from the original Form1.vb (or .cs) to the new Form1.Designer.vb (.cs) file.
Moved blocks can be even left commented in the original file (see picture below).
Features:
- given a project file, you can select which Forms / UserControls will be converted
- source code is parsed with a compiler-like parser; no Regular Expressions are used to ensure better results
- VB.NET and C# sources are fully supported
- C# fields were declared outside the #region; DeCodEx parses those fields type and moves only the ones derived from Control or Component
- splitting is done in a safe way, no lines were dropped: each original line will appear in Designer or in User file
- you can set force DeCodEx to leave the orinigal lines as commented in the original source file; a special line comment prefix will be added, allowing you to remove these lines afterward
- could create a backup of your project before starting conversion
- detailed activity log and error management
- can be run outside VisualStudio
Here you can see the result after the splitting (click to see the full image):
Click here to open download page.
Click here to view version history.



