Jon Jagger
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 17 Classesprevious at this levelnext at this level 17.7 Eventsprevious at this levelnext at this level 17.7.4 Virtual, sealed, override, and abstract accessors Paragraph 11 A virtual event declaration specifies that the accessors of that event are virtual. 2 The virtual modifier applies to both accessors of an event. Paragraph 21 An abstract event declaration specifies that the accessors of the event are virtual, but does not provide an actual implementation of the accessors. 2 Instead, non-abstract derived classes are required to provide their own implementation for the accessors by overriding the event. 3 Because an accessor for an abstract event declaration provides no actual implementation, its accessor-body simply consists of a semicolon. Paragraph 31 An event declaration that includes both the abstract and override modifiers specifies that the event is abstract and overrides a base event. 2 The accessors of such an event are also abstract. Paragraph 41 Abstract event declarations are only permitted in abstract classes (§ Paragraph 51 The accessors of an inherited virtual event can be overridden in a derived class by including an event declaration that specifies an override modifier. 2 This is known as an overriding event declaration. 3 An overriding event declaration does not declare a new event. 4 Instead, it simply specializes the implementations of the accessors of an existing virtual event. Paragraph 61 An overriding event declaration must specify the exact same accessibility modifiers, type, and name as the overridden event. Paragraph 71 An overriding event declaration may include the sealed modifier. 2 Use of this modifier prevents a derived class from further overriding the event. 3 The accessors of a sealed event are also sealed. Paragraph 81 It is a compile-time error for an overriding event declaration to include a new modifier. Paragraph 91 Except for differences in declaration and invocation syntax, virtual, sealed, override, and abstract accessors behave exactly like virtual, sealed, override and abstract methods. 2 Specifically, the rules described in §17.5.3, §17.5.4, §17.5.5, and §17.5.6 apply as if accessors were methods of a corresponding form. 3 Each accessor corresponds to a method with a single value parameter of the event type, a void return type, and the same modifiers as the containing event.
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS