Bug 8856 - GUI source code generator doesn't support properly EventHandler<> and nested classes
Summary: GUI source code generator doesn't support properly EventHandler<> and nested ...
Status: NEW
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: GTK# Designer ()
Version: 3.0.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-12-09 07:12 UTC by Mirek
Modified: 2012-12-09 07:14 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 8856 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Mirek 2012-12-09 07:12:52 UTC
Hi All,

I've run into the following bug in the MonoDevelop.

Consider a subclassed TreeView like this

    public class CustomTreeView
        public event EventHandler<CustomEventArgs> OnCustomEvent;

        public class CustomEventArgs : EventArgs { }

I can see the new event properly in the UI designer and I can double click the event to have the event handler generated. However the source code generated has invalid syntax and the project will not compile.

bug #1 is in the partial class responsible for building the UI

    this.customtreeview1.OnCustomEvent += 
        new global::System.EventHandler<><CustomTreeView.CustomEventArgs>(this.OnCustomTreeViewCustomEvent);

Note the extra "<>" characters after the EventHandler class

bug #2 is the signature for the OnCustomTreeViewCustomEvent method handling the event

    protected void OnCustomTreeViewCustomEvent (object sender, CustomTreeView/CustomEventArgs e)...

Note the slash "/" character instead of "." (I only guess this is due to the nested class definition)