Which of the following statements about inheritance and events is false?

  1. A derived class can raise a base class event by using code similar to the following:
    if (base.EventName != null) base.EventName(this, args);
  2. A derived class cannot raise an event defined in an ancestor class.
  3. A class can define an OnEventNamemethod that raises an event to allow derived classes to raise that event.
  4. A derived class inherits the definition of the base class’s events, so a program can subscribe to a derived object’s event.

Good question.

댓글

이 블로그의 인기 게시물

Oracle NLS_DATE_FORMAT 변경

Alternative to IValueConvert, QuickConverter

Reflection with IDispatch-based COM objects