Open sandboxFocus

Class InternalAttribute

ReferentialConstraint, when applied to a declaration, prevents it to be used from a different assembly. This constraint can be used when a declaration must be made public for technical reasons, but its author does not want it to be used in external code.

Namespace: PostSharp.Constraints
Assembly: PostSharp.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Module|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Event|AttributeTargets.Interface|AttributeTargets.Delegate, AllowMultiple = true)]
[MulticastAttributeUsage(MulticastTargets.AnyType|MulticastTargets.Field|MulticastTargets.Method|MulticastTargets.InstanceConstructor, TargetMemberAttributes = MulticastAttributes.Public, TargetTypeAttributes = MulticastAttributes.Public|MulticastAttributes.UserGenerated)]
public sealed class InternalAttribute : ReferentialConstraint, IReferentialConstraint, IConstraint

Constructors

Name Description
InternalAttribute()

Initializes a new InternalAttribute.

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.