PostSharpAPI ReferencePost­Sharp.​ConstraintsProtected­Attribute
Open sandboxFocus

ProtectedAttribute Class

Custom attribute that, when applied to a target declaration, causes PostSharp to emit a warning if the declaration is being referenced from classes that are not derived from the target class. This constraint is similar to the C# keyword protected and should be used only when the target declaration must be made public or internal for non-architectural reasons.

Inheritance
System.Object
ProtectedAttribute
Namespace: PostSharp.Constraints
Assembly: PostSharp.dll
Syntax
[MulticastAttributeUsage]
public sealed class ProtectedAttribute : ReferentialConstraint, IReferentialConstraint, IConstraint

Constructors

Name Description
ProtectedAttribute()

Initializes a new ProtectedAttribute.

Properties

Name Description
Severity

Gets or sets the severity of messages emitted by this constraint.

Methods

Name Description
ValidateCode(Object, Assembly)

Validates the constraint.

ValidateConstraint(Object)

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