How to trigger the event of GoLink.OnGotSelection?

Hi,

I just start to learn GoDiagram. I define a class based on GoLink and override the method OnGotSelection. The code is like the following example.

class MyLink: GoLink
{
public override void OnGotSelection(GoSelection sel)
{
base.OnGotSelection(sel);
}
}

I aim to handle the event when a link is selected, but the event is not fired after I click a link to select it. I mean the method OnGotSelection is not called at all. What’s the problem? What’s the correct way of handling selection of GoLink? Thanks for any comment.

Forchat

That should work. Are you sure you are creating a MyLink? Are you setting the GoView.NewLinkPrototype property?

Thanks Jake. Your comment was helpful. I forgot I used MyLink in a GoLabeledLink, so actually I selected the latter. Now I’ve got everything done. Smile