PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​ContextsSuspendable­Logging­Context
Open sandboxFocus

SuspendableLoggingContext Class

A LoggingContext that represents a method or activity that can be suspended and resume (possibly on a different thread), such as an async method or an iterator.

Inheritance
System.Object
SuspendableLoggingContext
Namespace: PostSharp.Patterns.Diagnostics.Contexts
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
public abstract class SuspendableLoggingContext : LoggingContext, ILoggingContext

Properties

Name Description
IsSuspended

Determines whether the current context is currently suspended (between a Suspend() and a Resume()).

ThreadContext

Gets the ThreadLoggingContext for the thread in which the current LoggingContext is currently executed.

Methods

Name Description
Dispose(Boolean)

Disposes the current object.

Resume()

Resumes the current context. Typically called when the state machine resumes execution, when the wait dependency is satisfied (in case of async methods) or when the MoveNext() method is called (in case of iterators).

ResumeConditional()

Resume the current context, but only if it is currently suspended.

Suspend()

Suspends the current context. Typically called when starting to wait for a wait dependency (the operand of the await operator in case of async methods), or after the MoveNext() method (in case of iterators).

ToString(StringBuilder)

Formats a description of the current LoggingContext into a given System.Text.StringBuilder.