Versions Compared

Key

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

The version of gmStudio published 08/21/2023 version of gmStudio changes how control events are hooked to handlers in designer code.

By default, event hookups now use a generic Prior to the 5/30/2023 release, all events hookup used the specialized delegate form:

Code Block
this.tvTreeView.NodeMouseClick += new System.Windows.Forms.EventHandler<TreeNodeMouseClickEventArgs>TreeNodeMouseClickEventHandler(this.tvTreeView_NodeClick);

In the last release (5/30/2023), all events hookup here modified to use the simplified form:

Code Block
this.tvTreeView.NodeMouseClick += this.tvTreeView_NodeClick;

Prior to the 5/30/2023 release, all events hookup used the specialized delegate form:

Code Block
this.tvTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvTreeView_NodeClick);

The simplified form was introduced as part of the even event handler enhancements implemented with the 5/30 release.  It was selected because it supports both specialized delegates and generic delegates.  However, when one modifies and saves a form in the Visual Studio designer, all of the simplified event handler hookups were removed from the rewritten form!  This makes the form non-functional.  In order for the hookups to be retained by the VS Designer rewriting process, a generic or specialized delegate must be used. 

If you are migrating to a stub control generated by the tool (e.g. the default) then the event will have a generic delegate and no action is needed.  However, if you are migrating to a .NET control (e.g. a WinForms control) then it is likely that the event will require the more traditional specialized delegate form.  This must be specified in the migration rules using a specializedHookup=on attribute in the migration rules for the event, for example:

...

Some of the sample rules distributed with gmStudio have been updated to reflect this requirement.


NOTE: The WinForms Designer for .NET Core supports simplified handler hookups.  We will consider this in the upcoming .NET Core feature planned for late 2023.

Please let us know if you have questions or require assistance.