Small tool to help Winforms migration

Hi,

Happy new year for all !

I want to “migrate” a Winforms application to AlterNet UI to be used with Windows, MacOS and Linux.

This application contain a lot of forms. I don’t want to open each one to analyze if it can be “migrate” to AlterNet UI. So I have started to code a small tool to help me and save a lot of time.

Step 1 : select folder contains my projeect
Step 2 : open each *.designer.cs file
Step 3 : identify Forms’s components used
Step 4 : identify Forms’s Enum used
Step 5 : produce a small report like this

               ====== Report for : D:\temp\Project1\src ======

Controls :


Label
RichTextBox
Button
ListBox
PictureBox
Panel
GroupBox
CheckBox
ComboBox
RadioButton
Timer
ListView
WebBrowser
ContextMenuStrip
ToolStripMenuItem
ToolStripSeparator


Enums :


AutoScaleMode.Font
Cursors.Hand
BorderStyle.None
DialogResult.OK
FlatStyle.Flat
FormBorderStyle.None
FormStartPosition.CenterScreen
BorderStyle.FixedSingle
RichTextBoxScrollBars.Vertical
FormStartPosition.Manual
((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)))
((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
PictureBoxSizeMode.StretchImage
RichTextBoxScrollBars.None
ImageLayout.Stretch
((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
FlatStyle.Popup
((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)))
ImageLayout.Zoom
AutoScaleMode.None
DockStyle.Fill
DockStyle.Top
DockStyle.Bottom
FormWindowState.Maximized

Now I can analyze quickly if AlterNet UI have all components and all methods I need to start the migration (using the good documentation here : Alternet.UI Namespace).

I have create this Excel file to help to find equivalent between Winforms/WPF/AlterNetUi :

In this case, with these small inputs I can see in few seconds that I need RichTextBox, WebViewer, ToolStripMenuItem and ToolStripSeparator.

Tell me what do you think about this tool ? Even if it is in alpha version, I can share it and Excel if you need.

Have a good day !

NeoXeo

My first tool using AlterNet UI : :slight_smile:

Next step :
Add a convertor : I have started to code a tool to migrate Winforms project to an AlterNet UI project (create csproj and convert all winforms into uixml files)

Hello and Happy New Year,

Thank you for your detailed post, and a comparison between WinForms/WPF/AlterNET UI.

For FlowLayoutPanel you can also try StackPanel as a replacement for FlowLayoutPanel; ColorDialog and Directory Dialog are also implemented (you can look at CommonDialogSample for details). We will definitely look at supporting missing controls.

We’re about to release the first public release (version 1.0), with scrollable control support.

As for the converter tool, we don’t have any as yet, but will definitely have one down the track.

Kind regards,
Dmitry

Thank you very much for your answer.

I can post a google doc or send you Excel file comparison between WinForms/WPF/AlterNET UI if you need it.

I will have a look for StackPanel as a replacement for FlowLayoutPanel; ColorDialog and Directory Dialo.

It is a very good new : “We will definitely look at supporting missing controls” and “first public release (version 1.0), with scrollable control support”. Thanks a lot

For conveter tool, I can share with you my progress with my tool and why not, share the tool with you if you are interesting. I think 60% of code is written but have a lot of job and not enough time to work on it. I hope to progress saturday and sunday for a first alpha release.

Last thing, can you have a look to my post about “previewer error” and give me an answer, please.

Thank you again.

Regards,
NeoXeo

Hi NeoXeo,

It would be great if you could share the converter tool you’re working on. And yes, a google document with the comparison of WinForms/WPF/AlterNET UI would be very helpful too.

Kind regards,
Dmitry

Hi,

First alpha version of converter is ready. I will share with you quickly.
I have sent Excel file. You can complete it with new informations for AlterNet UI and publish it if you want.

Have a good week !

Hi NeoXeo,

Thank you for sharing the Excel file we will take a closer look at it. The same applies to the converter tool you’re working on.

Kind regards,
Dmitry