T
Ty
Hi all
i'm playing a bit with automatic ressource cleaning. here's my
problem. Little test code:
public class TestClass
{
public event EventHandler OnFire;
private void TestMethod()
{
OnFire.GetInvocationList();
}
}
This compiles fine (disregard that OnFire.GetInvocationList() doesn't
do anything useful)
Now if i try to add accessors to the OnFire-event like this:
public class TestClass
{
public event EventHandler OnFire
{
add{}
remove{}
}
private void TestMethod()
{
OnFire.GetInvocationList();
}
}
I get this error with OnFire.GetInvocationList()
** The event 'OnFire' can only appear on the left hand side of += or -
=
is there a way to define cusom-accessors and still have all Methods of
"OnFire" available?
Thank you!
i'm playing a bit with automatic ressource cleaning. here's my
problem. Little test code:
public class TestClass
{
public event EventHandler OnFire;
private void TestMethod()
{
OnFire.GetInvocationList();
}
}
This compiles fine (disregard that OnFire.GetInvocationList() doesn't
do anything useful)
Now if i try to add accessors to the OnFire-event like this:
public class TestClass
{
public event EventHandler OnFire
{
add{}
remove{}
}
private void TestMethod()
{
OnFire.GetInvocationList();
}
}
I get this error with OnFire.GetInvocationList()
** The event 'OnFire' can only appear on the left hand side of += or -
=
is there a way to define cusom-accessors and still have all Methods of
"OnFire" available?
Thank you!