1

当我双击 Clicked 信号以添加新的 Clicked 事件时,它不会自动添加代码。它显示错误

错误单体开发

我使用最新版本的 Monodevelop 和 Gtk# Toolkit 和 Window7 平台如何修复它?

4

2 回答 2

0

尝试手动添加。在窗口类的构造函数中写入:

yourElement.Clicked += new EventHandler(Method);
void Method(~)
{
//logic
}

其中EventHandlerClicked事件的委托类型,Method是方法,与EventHandler签名相同。

于 2012-06-08T11:02:56.573 回答
0

这是 MonoDevelop 3.0.1 中仍然存在的错误。在下面查看完整的堆栈跟踪。手动添加偶数就像 Arman Stepanyan 描述的那样。

System.Reflection.TargetInvocationException:调用的目标已引发异常。---> System.NotImplementedException:请求的功能未实现。在 MonoDevelop.Ide.TypeSystem.CodeGenerationService.GetSuitableInsertionPoint(IEnumerable`1 点,IUnresolvedTypeDefinition cls,IUnresolvedMember 成员)[0x0003e] 在 /build/buildd/monodevelop-3.0.1/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide .TypeSystem/CodeGenerationService.cs:335 在 MonoDevelop.Ide.TypeSystem.CodeGenerationService.AddNewMember(ITypeDefinition 类型,IUnresolvedTypeDefinition 部分,IUnresolvedMember newMember,Boolean implementExplicit)[0x00043] 在 /build/buildd/monodevelop-3.0.1/main/src/核心/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs:91 在 MonoDevelop.GtkCore.GuiBuilder.CodeBinder.BindSignal (Stetic.AnonStoreyD.<>m_17 (System.Object , System.EventArgs) [0x00000] 在 :0 在 Stetic.GuiDispatch.InvokeSync (System.EventHandler h) [0x00000] 在 :0 在 Stetic.Project.NotifySignalAdded (System.Object obj, System.String 名称, Stetic.Signal 信号) [0x00000] in :0 at (wrapper remoting-invoke-with-check) Stetic.Project:NotifySignalAdded (object,string,Stetic.Signal) 在 Stetic.ProjectBackend.Stetic.IProject.NotifySignalAdded (Stetic. SignalEventArgs args) [0x00000] in :0 at Stetic.ObjectWrapper.OnSignalAdded (Stetic.SignalEventArgs args) [0x00000] in :0 at Stetic.SignalCollection.OnInsertComplete (Int32 index, System.Object value) [0x00000] in :0 at System .Collections.CollectionBase.System.Collections.IList.Add (System.Object value) [0x00000] in :0 --- End of internal exception stack trace --- at System.Reflection.MonoMethod。在 System.Reflection.MethodBase.Invoke (System.Object obj , System.Object[] 参数) [0x00000] in :0 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in :0 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000 ] in :0 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in :0 at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in :0 在 GLib。 SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in :0 at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint,IntPtr marshal_data) [0x00000] in :0

于 2012-11-10T08:22:09.797 回答