Open sandboxFocus

Class NamingConventionAttribute

Custom attribute that, when applied to a target class or an interface, validates that classes and interfaces derived from this target class or interface respect a given naming convention, that is, that their names match a given pattern.

Inheritance
NamingConventionAttribute
Namespace: PostSharp.Constraints
Assembly: PostSharp.dll
Syntax
[MulticastAttributeUsage(MulticastTargets.Class|MulticastTargets.Interface, Inheritance = MulticastInheritance.Strict)]
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Interface)]
public sealed class NamingConventionAttribute : ScalarConstraint, IScalarConstraint, IConstraint

Constructors

Name Description
NamingConventionAttribute(string)

Initializes a new instance of the NamingConventionAttribute class.

Properties

Name Description
Severity

Gets or sets the severity of messages reporting violations of the current naming convention.

Methods

Name Description
ValidateCode(object)

Validates the element of code to which the constraint is applied.

ValidateConstraint(object)

Validates that the constraint has been applied to a valid element of code. When this method returns false, the constraint is silently ignored.