Visual Studio Team System
Events should not have before or after prefix

TypeName

EventsShouldNotHaveBeforeOrAfterPrefix

CheckId

CA1713

Category

Microsoft.Naming

Breaking Change

Breaking

Cause

The name of an event starts with 'Before' or 'After'.

Rule Description

Event names should describe the action that raises the event. To name related events that are raised in a specific sequence, use the present or past tense to indicate the relative position in the sequence of actions. For example, when naming a pair of events raised when closing a resource, you might name them 'Closing' and 'Closed', instead of 'BeforeClose' and 'AfterClose'.

Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve required for new software libraries, and increases customer confidence that the library was developed by someone with expertise in developing managed code.

How to Fix Violations

Remove the prefix from the event name, and consider changing the name to use the present or past tense of a verb.

When to Exclude Warnings

Do not exclude a warning from this rule.

Tags :


Community Content

David M. Kean - MSFT
More Information

For more information on the guidelines this rule enforces, see the following external resources:

Names of Type members, Design Guidelines for Developing Class Libraries
http://msdn2.microsoft.com/en-us/library/ms229012.aspx

Page 63, Framework Design Guidelines: Conventions, Idioms and Patterns for Reusable .NET Libraries
Krzysztof Cwalina and Brad Abrams
http://www.amazon.com/gp/product/0321246756/002-6248839-4752853?v=glance&n=283155

Tags :

Page view tracker