Is there any way that I can create a new delegate type based on an existing one? In my case, I\'d like to create a delegate MyMouseEventDelegate
which would have th
I didn't believe jon-skeet. I had to try it for myself. He was right.
public void F(object sender, MouseEventArgs e) {};
public MyLeftClickHandler l;
public MyRightClickHandler r;
public void Test()
{
l = F; // Automatically converted.
r = F; // Automatically converted to a different type.
l = r; // Syntax error. Incompatible types.
l = new MyLeftClickHandler(r); // Explicit conversion works.
}
That wasn't obvious!