Hello:
Today I learned that the + operator cannot be passed a delegate. I get
an error from the CLR saying I have an invalid program.
With that, I was wondering if someone could tell me what other types I
am not allowed to make parameters.
Thanks,
Travis
class Failer
{
public static Failer operator +(Failer failer,
MulticastDelega te handler)
{
return failer;
}
public static void Test()
{
Failer failer = new Failer();
object o = failer + new EventHandler(
delegate(object sender, EventArgs e)
{
// DO NOTHING
});
}
}
Today I learned that the + operator cannot be passed a delegate. I get
an error from the CLR saying I have an invalid program.
With that, I was wondering if someone could tell me what other types I
am not allowed to make parameters.
Thanks,
Travis
class Failer
{
public static Failer operator +(Failer failer,
MulticastDelega te handler)
{
return failer;
}
public static void Test()
{
Failer failer = new Failer();
object o = failer + new EventHandler(
delegate(object sender, EventArgs e)
{
// DO NOTHING
});
}
}
Comment