Bit*_*lue 2 c# compiler-construction events derived-class
我在类Alice中有一个事件要在派生类中引发Bob:
public class Alice
{
public event Action<object> ValueChanged;
}
public class Bob : Alice
{
public void method1(Alice bigAlice)
{
// raise ValueChanged event
// or
// raise ValueChanged event on bigAlice
}
}
Run Code Online (Sandbox Code Playgroud)
编译器错误说我只能使用+=,-=如果我不在事件的声明类中.我怎么能从鲍勃的代码中解雇那个事件呢?