Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Threading Namespace / Assume­Immutable­Attribute Class

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 Hierarchy
System.Object
  System.Attribute
    PostSharp.Patterns.Threading.AssumeImmutableAttribute

Namespace:  PostSharp.Patterns.Threading
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 5.1.3.0 (5.1.3.0)
Syntax
C#
public sealed class AssumeImmutableAttribute : Attribute

The AssumeImmutableAttribute type exposes the following members.

Constructors
  NameDescription
Public methodAssumeImmutableAttribute()
Initializes a new instance of the AssumeImmutableAttribute custom attribute that can be applied to a specific targetType.
Public methodAssumeImmutableAttribute(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
  NameDescription
Public propertyTargetType
Gets the targetType that should be assumed immutable, if the AssumeImmutableAttribute(Type) constructor was used.
Extension Methods
  NameDescription
Public Extension MethodQueryInterface<T>
Gets the implementation of a specified interface for the specified object.
(Defined by QueryInterfaceExtensions.)
See Also