Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

My experience with Wisej is limited to only a few hours of playing around, but I find it to be an an incredibly sophisticated development and runtime framework.  I would love to say more, but I certainly cannot do it justice here.  Visit Wisej on the web to learn more. 

I recently automated a simple VB6 desktop to web migration using the WiseJ Wisej framework. 

See the screen shot below

  • Left: Calculator Form in VB6 designer
  • Middle: Calculator Form in WiseJ Wisej designer in Visual Studio
  • Right: Calculator Form running in Chrome as a web application

Image RemovedImage Added

The web version works much like the original -- even including the keyboard support.

For this sample there were only a few differences from simply letting gmStudio do a standard VB6 to WinForms upgrade:

  • Using a WiseJ Wisej web application csproj file rather than the one generated for a WinForms app
  • Using a WiseJ Wisej startup code file rather than the one generated for Winforms
  • Adding appropriate Deploying a few supporting files to the .NET project folder (default.html, default.json, web.configs) using a user batch command 
  • A number of tweaks to the code to address places where WiseJ Wisej conventions differ from WinForms

For the this first test, I simply used the gmPL post editor -editting commands make the changesreplacements.  (see “Quick and Dirty” rules below)

In an actual upgrade solution, I would create a generalized WiseJ Wisej upgrade configuration that could be used with many different VBPs and forms code files and also develop a set of rules files to deal with third-party controls.  In a project context, we would further customize this the rules so that various customer-specific requirements are automated including such as other WiseJWisej/.NET standards.

“Quick and Dirty” upgrade rules to rewrite from VB6 (desktop) for WiseJWisej/C# (web)

Code Block
   <Author>
   <Fix host="Calculator" name="PostEdit">
   <Replace status="active" name="changeremove namespace Winforms to WiseJ.Web" using WinForms">
   <OldBlock><![CDATA[using System.Windows.Forms;]]></OldBlock>
   <NewBlock><![CDATA[using Wisej.Web;]]></NewBlock>
   </Replace>
   <Replace statusname="active" name="remove using WinForms"change namespace Winforms to Wisej.Web" >
   <OldBlock><![CDATA[System.Windows.Forms.]]></OldBlock>
   <NewBlock><![CDATA[Wisej.Web.]]></NewBlock>
   </Replace>
   <Replace status="active" name="remove FlatStyle">
   <OldBlock><![CDATA[FlatStyle]]></OldBlock>
   </Replace>
   <Replace status="active" name="cleanupremove using System.Data">
   <OldBlock><![CDATA[using System.Data;]]></OldBlock>
   </Replace>
   <Replace status="active" name="cleanupremove using System.CompilerServices">
   <OldBlock><![CDATA[using Microsoft.VisualBasic.CompilerServices;]]></OldBlock>
   </Replace>
   <Replace name="rework old MenuStrip initialization boilerplate, not needed">
   <OldBlock><![CDATA[
            this.MainMenuStrip = this.mainMenu1;
            this.mainMenu1.AutoSize = false;
            this.MainMenuStrip.Height = 20;
            this.Controls.Add(this.mainMenu1);
   ]]></OldBlock>
   <NewBlock><![CDATA[
            this.Menu = this.mainMenu1;
   ]]></NewBlock>
   </Replace>
   <Replace status="active" name="rename MenuStrip class">
   <OldBlock><![CDATA[MenuStrip]]></OldBlock>
   <NewBlock><![CDATA[MainMenu]]></NewBlock>
   </Replace>
   <Replace status="active" name="rename ToolStripMenuItem class">
   <OldBlock><![CDATA[ToolStripMenuItem]]></OldBlock>
   <NewBlock><![CDATA[MenuItem]]></NewBlock>
   </Replace>
   <Replace name="Remove hideSelection setting (default?)">
   <OldBlock><![CDATA[.HideSelection = ]]></OldBlock>
   </Replace>
   <Replace name="Rename BorderStyle enum entry">
   <OldBlock><![CDATA[.BorderStyle.Fixed3D;]]></OldBlock>
   <NewBlock><![CDATA[.BorderStyle.Solid;]]></NewBlock>
   </Replace>
   <Replace name="Rename BorderStyle enum entry">
   <OldBlock><![CDATA[.BorderStyle.FixedSingle;]]></OldBlock>
   <NewBlock><![CDATA[.BorderStyle.Solid;]]></NewBlock>
   </Replace>
   <Replace status="active" name="rework ShortcutKeys">
   <OldBlock><![CDATA[ShortcutKeys = Keys.Control | Keys.]]></OldBlock>
   <NewBlock><![CDATA[Shortcut = Shortcut.Ctrl]]></NewBlock>
   </Replace>
   <Replace name="Change menu.Items property name">
   <OldBlock><![CDATA[this.mainMenu1.Items.AddRange(new Wisej.Web.ToolStripItem]]></OldBlock>
   <NewBlock><![CDATA[this.mainMenu1.MenuItems.AddRange(new Wisej.Web.MenuItem]]></NewBlock>
   </Replace>
   <Replace name="change menu.DropDownItems name">
   <OldBlock><![CDATA[this.mnuEdit.DropDownItems.AddRange(new Wisej.Web.ToolStripItem[] {]]></OldBlock>
   <NewBlock><![CDATA[this.mnuEdit.MenuItems.AddRange(new Wisej.Web.MenuItem[] {]]></NewBlock>
   </Replace>
   <Replace name="rename FormBorderStyle enum entry">
   <OldBlock><![CDATA[.FormBorderStyle.FixedSingle;]]></OldBlock>
   <NewBlock><![CDATA[.FormBorderStyle.Fixed;]]></NewBlock>
   </Replace>

   <ReplaceFile name="Override csproj file using WiseJWisej.csproj"
       lang="csproj"    
       source="Calculator.csproj"
       target="..\usr\wiseJWisej\WiseJWisej.csproj"
   />
   <ReplaceFile name="Override startup file using program.cs"
       lang="csproj"    
       source="Calculator_StartUp.cs"
       target="..\usr\wiseJWisej\program.cs"
   />
   </Fix>   
   </Author>