PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingAssume­Immutable­Attribute
Open sandboxFocus

AssumeImmutableAttribute Class

Custom attribute that, when applied to a targetType, means that targetType should be assumed to be immutable. The custom attribute can be applied to a type on assembly level by specifying the Type property using the AssumeImmutableAttribute(Type) constructor.

Inheritance
AssumeImmutableAttribute
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Common.dll
Syntax
public sealed class AssumeImmutableAttribute : Attribute

Constructors

Name Description
AssumeImmutableAttribute()

Initializes a new instance of the AssumeImmutableAttribute custom attribute that can be applied to a specific targetType.

AssumeImmutableAttribute(Type)

Initializes a new instance of the AssumeImmutableAttribute custom attribute that can be applied to an assembly, passing the immutable as a constructor argument. This constructor allows to add assumptions for types that are not defined in this current assembly.

Properties

Name Description
TargetType

Gets the targetType that should be assumed immutable, if the AssumeImmutableAttribute(Type) constructor was used.