Open sandboxFocus

Class AsyncCustomActivityLoggingContext

A LoggingContext that represents an asynchronous custom activity, i.e. an activity opened using OpenAsyncActivity(string).

Namespace: PostSharp.Patterns.Diagnostics.Contexts
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
public class AsyncCustomActivityLoggingContext : AsyncLoggingContext, ICustomActivityLoggingContext, ILoggingContext, IDisposable

Constructors

Name Description
AsyncCustomActivityLoggingContext(LoggingBackend)

Gets the logging transaction that this activity opened, if any.

Properties

Name Description
CustomActivityKind

Gets the kind of LogActivity represented by the current context.

DefinedTransaction

Gets the LoggingTransaction defined by the current context.

IsHidden

Determines whether the current LoggingContext is hidden. Hidden contexts may define properties but should not be rendered.

StartTimestamp

Gets the timestamp (given by CurrentTimestamp) of the moment when the activity started.

SyntheticParentId

When this property returns a non-null value, the SyntheticId property shall use the value of the SyntheticParentId property as the parent identifier, instead of recursively building the synthetic identifier based on ParentContext. You can set this property when you open a custom activity by configuring the OpenActivityOptions object.

SyntheticRootId

When this property returns a non-null value, the SyntheticId property shall return the same value as the SyntheticRootId property, instead of starting with the id of the parent context. You can set this property when you open a custom activity by configuring the OpenActivityOptions object.

Methods

Name Description
Dispose(bool)

Disposes the current object.

GetExecutionContextData(LoggingExecutionContextData, bool)

Returns a new layer for the async stack that has this LoggingContext as the associated activity and current as the PostSharp.Patterns.Diagnostics.Contexts.LoggingExecutionContextData.Parent, if a new layer is required.

Open(LoggingTypeSource, in OpenActivityOptions)

Opens the current context.

SetWaitDependency(object)

Sets the wait dependency for the current context, i.e. sets a representation of what the current context is waiting for. This operation is available only in custom contexts.