Skip to content

Gendarme.Rules.Naming.DoNotPrefixEventsWithAfterOrBeforeRule(git)

Sebastien Pouliot edited this page Mar 2, 2011 · 1 revision

DoNotPrefixEventsWithAfterOrBeforeRule

Assembly: Gendarme.Rules.Naming
Version: git

Description

This rule ensures that event names are not prefixed with After or Before. The .NET naming conventions recommend using a verb in the present and in the past tense.

Examples

Bad example:

public class Bad {
    public event ResolveEventHandler BeforeResolve;
    public event ResolveEventHandler AfterResolve;
}

Good example:

public class Good {
    public event ResolveEventHandler Resolving;	// present
    public event ResolveEventHandler Resolved;	// past
}

Source code

You can browse the latest source code of this rule on github.com

Clone this wiki locally