S2349 — Event names should not have "Before" or "After" as a prefix or suffix

Language
VB.NET
Type
Code smell
Severity
Minor
Tags
convention

Why is this an issue?

"After" and "Before" prefixes or suffixes should not be used to indicate pre and post events. The concepts of before and after should be given to events using the present and past tense.

Noncompliant code example


Class Foo
    Event BeforeClose() ' Noncompliant
    Event AfterClose()  ' Noncompliant
End Class

Compliant solution


Class Foo
    Event Closing()     ' Compliant
    Event Closed()      ' Compliant
End Class

↑ Back to top