Open sandboxFocus

Class InternalImplementAttribute

ReferentialConstraint that, when applied to an interface, prevents it from being implemented in a different assembly. This constraint should be used when the author of an interface does not expect users to implement the interface and wants to reserve the possibility to add new methods to the interface.

Inheritance
InternalImplementAttribute
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.Interface, TargetTypeAttributes = MulticastAttributes.Public)]
public sealed class InternalImplementAttribute : ReferentialConstraint, IReferentialConstraint, IConstraint
Remarks

Implementing the interface in another assembly emits the warning AR0101, unless the assembly of the interface grants that assembly access with InternalsVisibleToAttribute. Set Severity to Error to make it an error. SuppressWarningAttribute can suppress the warning on the implementing type, but cannot suppress an error.

The implementing project must be processed by PostSharp for the constraint to be validated.

Constructors

Name Description
InternalImplementAttribute()

Initializes a new instance of the InternalImplementAttribute class.

Properties

Name Description
Severity

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

Methods

Name Description
ValidateCode(object, Assembly)

Validates the constraint.

See Also