PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingThread­Aware­Attribute
Open sandboxFocus

ThreadAwareAttribute Class

Base class for all aspects implementing threading models.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading.dll
Syntax
[ProvideAspectRole("ThreadingModel")]
[ProvideAspectRole("Threading")]
[AspectRoleDependency]
[AspectRoleDependency]
[AspectRoleDependency]
[AspectRoleDependency]
[AspectRoleDependency]
[MulticastAttributeUsage]
[IntroduceInterface]
[IntroduceInterface]
[HasConstraint]
[Serializer]
public abstract class ThreadAwareAttribute : AggregatableClientAttribute, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, IAspectProvider, IService, IAdviceProvider, IAspect, IThreadAware, IQueryInterface

Constructors

Name Description
ThreadAwareAttribute(PortableFormatterConstructorContext)

Fields

Name Description
__GetThreadAwareImplMethod
__GetThreadAwareImplMethodBase
BaseFinalizeMethod
BaseQueryInterface
OnParentChangedMethod
OnSerializingBaseMethod
QueryInterfaceMethod
UseParentConcurrencyControllerMethod

Properties

Name Description
RuntimeVerificationEnabled

Determines whether the code should be verified against the model at runtime. The default value is true for the debug build configuration and false for the release build configuration.

Methods

Name Description
__GetThreadAwareImpl()
Advise(Object)

Injects the advice into the child object.

CompileTimeValidate(Type)

Method invoked at build time to ensure that the aspect has been applied to the right target.

Finalize()

Destructor.

IsEligibleChild(Object, ChildInfo)

Determines if an object is eligible to be a child of the target instance of the current aspect.

OnAdviseChildFailed(Object)

Method invoked when a child is assigned to a parent and the advices of the parent cannot be added to the child. Implementations can choose to throw an exception (thread-aware attributes do this) or ignore the situation (DisposableAttribute does this).

OnAsyncMethodEntry(DeclarationIdentifier, out FlowBehavior, out ConcurrentAccessAwaiter, out Int32)
OnAsyncMethodException(ref ConcurrentAccessToken)
OnAsyncMethodResume(ref FlowBehavior, ref ConcurrentAccessAwaiter, ref Int32, ref ConcurrentAccessToken)
OnAsyncMethodSuccess(ref ConcurrentAccessToken)
OnAsyncMethodYield(ref ConcurrentAccessToken, ref Int32)
OnFieldGet<T>(ILocationBinding<T>, Object, out T)
OnFieldSet<T>(ILocationBinding<T>, Object, T)
OnInstanceConstructed()
OnMethodEntry(DeclarationIdentifier, out ConcurrentAccessToken)
OnMethodException(ref ConcurrentAccessToken)
OnMethodResume(ref ConcurrentAccessToken)
OnMethodSuccess(ref ConcurrentAccessToken)
OnParentChanged()
OnSerializing(StreamingContext)

Requires read access level to the current object before serialization can proceed. This method will be introduced into the target class.

OnSynchronizedEventAdd(EventInterceptionArgs)
OnSynchronizedEventRemove(EventInterceptionArgs)
OnYieldEventInvoke(EventInterceptionArgs)
ProvideAdvices(Object)
QueryInterface(Type)
QueryInterface<T>()
RuntimeInitialize(Type)
RuntimeInitializeInstance()

Explicit Interface Implementations

Name Description
IThreadAware.ConcurrencyController

Gets the concurrency controller for the current object.

IThreadAware.OnParentControllerChanged(IConcurrencyController)