PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingFreezable­Attribute
Open sandboxFocus

Class FreezableAttribute

Custom attribute that, when applied to a class, implements the FreezableThreadingModel to this class. The aspect introduces the IFreezable interface into the target class. After the Freeze() method has been invoked, the object can no longer be modified, and can therefore be safely shared between several threads.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading.dll
Syntax
[IntroduceInterface]
[Metric("UsedFeatures", "PostSharp.Patterns.Threading.Freezable")]
[Serializer]
public sealed class FreezableAttribute : ReadOnlyThreadAwareAttribute, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, IAspectProvider, IService, IAdviceProvider, IAspect, IQueryInterface, IConcurrencyController, IFreezable, IThreadAware

Constructors

Name Description
FreezableAttribute() PostSharp.Patterns.Threading.FreezableAttribute
FreezableAttribute(PortableFormatterConstructorContext)

Methods

Name Description
Advise(Object)
OnCloned(ICloneAwareAspect)

Method called after the an object enhanced by the current aspect has been cloned using MemberwiseClone(). The this parameter refers to the new aspect instance in the cloned object.

ToString()

Returns a string that represents the current object.

Explicit Interface Implementations

Name Description
IFreezable.Freeze()
IThreadAware.ConcurrencyController