Ben
Ben

Reputation: 575

Newbie trying to creating a Signal Event in MonoDevelop

Newbie here, just trying to create a signal event handler in response to an onclick menu item. Aint working for me. I click on the menu item, click signals, to the right of "Activated" where it says "Click to Add Handler", I type in "MyOnClick" then it shoots me out an error. weird. Exception has been thrown by the target of an invocation.

I am running this in windows 7 under a vm on macbook pro. Windows is not sharing folders from Macbook Pro so shouldn't be a UNC issue. Pathways seem fine.

Any ideas?

Ben

Upvotes: 0

Views: 952

Answers (1)

Robert Ostrowicki
Robert Ostrowicki

Reputation: 362

I have the same issue on mac and windows with current monodevelop versions.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotImplementedException: The method or operation is not implemented.

It's annoying me so much! Must be some bug.

EDIT: I've solve it!

In source add method like this:

         protected virtual void onClick (object sender, EventArgs e)
    {
        MessageDialog md = new MessageDialog (this, DialogFlags.Modal, 
MessageType.Error, ButtonsType.Close, "Some error"); 
        md.Response += delegate(object o, ResponseArgs args) { 
            if (args.ResponseId == ResponseType.Close) 
                Console.WriteLine ("Response: Closed");
            else 
                Console.WriteLine ("Other response happened."); 
        }; 
        md.Run (); 
        md.Destroy (); 
    }

Then switch to visual designer and instead double click on signal/method name just type in method name [this case] onClick (no brackets). This time a method is implemented and doesn't cause throwing error.

It work but is not as comfortable as double click.

Upvotes: 1

Related Questions