3级继承没有找到基本构造函数:错误“不包含带0参数的构造函数”

时间:2018-06-02 16:29:22

标签: c# multiple-inheritance

我想继承SpeechRecognizedEventArgs

public class AD_SpeechRecognitionEngineResult : SpeechRecognizedEventArgs
{
    //  public AD_SpeechRecognitionEngineResult():base() {  }
    //I get the same error whatever if I command this constructor declaration or not
}

编译器呻吟:

  

错误CS1729'SpeechRecognizedEventArgs'不包含   取0参数的构造函数

知道类继承这种方式::

public class SpeechRecognizedEventArgs : RecognitionEventArgs {}

public abstract class RecognitionEventArgs : EventArgs {} //this class only has a property but no declared constructor

public class EventArgs
{
     ...
    public EventArgs();
}

为什么编译器不会将EventArgs构造函数识别为AD_SpeechRecognitionEngineResult类的0参数的有效构造函数?

0 个答案:

没有答案