Bug 5059 - Signal (Even) handler created twice
Summary: Signal (Even) handler created twice
Status: CONFIRMED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: GTK# Designer ()
Version: 5.7
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-05-14 05:51 UTC by Peter Kornfeld
Modified: 2015-12-02 13:03 UTC (History)
4 users (show)

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


Attachments
Screenshot 1 (25.30 KB, image/png)
2012-05-21 02:55 UTC, Peter Kornfeld
Details
Screenshot 2 (9.68 KB, image/png)
2012-05-21 02:55 UTC, Peter Kornfeld
Details


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 5059 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:
Status:
CONFIRMED

Description Peter Kornfeld 2012-05-14 05:51:03 UTC
Hi,

When creating menu and adding handlers to its event, MD creates twice the handler function...
Comment 1 Miguel de Icaza [MSFT] 2012-05-19 00:40:58 UTC
Peter,

What kind of menu were you creating, for what kind of solution?

Gtk# solutions, Android solutions, other?
Comment 2 Peter Kornfeld 2012-05-21 02:55:15 UTC
Created attachment 1926 [details]
Screenshot 1
Comment 3 Peter Kornfeld 2012-05-21 02:55:31 UTC
Created attachment 1927 [details]
Screenshot 2
Comment 4 Peter Kornfeld 2012-05-21 02:56:12 UTC
Hi Miguel,

I'm talking about a Gtk# (2.12) project.

I added two images two show it...
1.png is how it looks like from the Gtk# designer, and 2.png that shows the code generated after double-click on signal name...
Comment 5 Peter Kornfeld 2012-05-21 03:39:27 UTC
Hi Miguel,

I just update to 3.0.1 and thing worst then before...

When try to create handler as described before an exception thrown..

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotImplementedException: The method or operation is not implemented.
   at MonoDevelop.Ide.TypeSystem.CodeGenerationService.GetNewMethodPosition(IEnumerable`1 points, IUnresolvedTypeDefinition cls)
   at MonoDevelop.Ide.TypeSystem.CodeGenerationService.GetSuitableInsertionPoint(IEnumerable`1 points, IUnresolvedTypeDefinition cls, IUnresolvedMember member)
   at MonoDevelop.Ide.TypeSystem.CodeGenerationService.AddNewMember(ITypeDefinition type, IUnresolvedTypeDefinition part, IUnresolvedMember newMember, Boolean implementExplicit)
   at MonoDevelop.GtkCore.GuiBuilder.CodeBinder.BindSignal(Signal signal)
   at MonoDevelop.GtkCore.GuiBuilder.GuiBuilderView.OnSignalAdded(Object sender, ComponentSignalEventArgs args)
   at Stetic.WidgetDesigner.OnSignalAdded(Object sender, ComponentSignalEventArgs args)
   at Stetic.Project.<>c__DisplayClass12.<NotifySignalAdded>b__11(Object , EventArgs )
   at Stetic.GuiDispatch.InvokeSync(EventHandler h)
   at Stetic.Project.NotifySignalAdded(Object obj, String name, Signal signal)
   at Stetic.ProjectBackend.Stetic.IProject.NotifySignalAdded(SignalEventArgs args)
   at Stetic.ObjectWrapper.OnSignalAdded(SignalEventArgs args)
   at Stetic.SignalCollection.OnInsertComplete(Int32 index, Object value)
   at System.Collections.CollectionBase.System.Collections.IList.Add(Object value)
   at Stetic.SignalCollection.Add(Signal signal)
   at Stetic.SignalsEditorBackend.AddHandler(TreeIter iter, String name)
   at Stetic.SignalsEditorBackend.OnRowActivated(Object sender, RowActivatedArgs args)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
   at GLib.SignalClosure.Invoke(ClosureInvokedArgs args)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
Comment 6 Peter Kornfeld 2015-03-29 16:06:45 UTC
Just got back to play around with Xamarin Studio and in version 5.7.1 with GTK# 2.12.26, the error still here...
Comment 7 Abhishek 2015-12-02 13:03:08 UTC
I have tried this issue and able to reproduce this issue at my end.

Steps To Reproduce:
1.Create an GTK# application.
2.Open Designer of MainWindow file.
3.Drag and drop Vbox onto the designer.
4.Drag and drop Menu bar.

Screencast: http://www.screencast.com/t/zhvLa1dN4yY
IDE log: https://gist.github.com/Abhishekk360/b016a587ddb2cd42a34b

Environment Info:

=== Xamarin Studio ===

Version 5.10.2 (build 14)
Installation UUID: 9964a087-9af9-4da0-aa20-07ca4b85f306
Runtime:
	Microsoft .NET 4.0.30319.42000
	GTK+ 2.24.23 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Profiler ===

Version: 0.16.56.0
Location: C:\Program Files (x86)\Xamarin\Profiler\XamarinProfiler.exe

=== Xamarin.Android ===

Version: 6.0.0.34 (Enterprise Edition)
Android SDK: D:\android-sdk
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)

SDK Tools Version: 24.3.4

SDK Platform Tools Version: 23.0.1

SDK Build Tools Version: 23


Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)

=== Xamarin Android Player ===

Version: 0.6.1
Location: C:\Program Files\Xamarin Android Player\DeviceManager.exe

=== Build Information ===

Release ID: 510020014
Git revision: a05150ff9af3205952d9f2ab4417f8036205c035
Build date: 2015-11-30 15:14:42-05
Xamarin addins: e89ff179a2cbe19b4eca4ac3859248e25c20225a
Build lane: monodevelop-windows-cycle6

=== Operating System ===

Windows 6.1.7601.65536 (64-bit)