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 giving naming convention, i.e. that their names matches 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 NamingConventionAttribute. |
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 the fact that the constraint has been applied on a valid element of code. When this
method returns |