Click or drag to resize

ActivityScope Class

Helper class that simplifies work with activities.
Inheritance Hierarchy
SystemObject
  Atalasoft.Shared.DiagnosticsActivityScope

Namespace:  Atalasoft.Shared.Diagnostics
Assembly:  Atalasoft.Shared (in Atalasoft.Shared.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public class ActivityScope : IDisposable

The ActivityScope type exposes the following members.

Constructors
  NameDescription
Protected methodActivityScope
Initializes a new instance of the ActivityScope class.
Public methodActivityScope(TraceSource, String)
Initializes a new instance of the ActivityScope class.

Sets new activity id, trace transfer to the new activity and start new logical operation.

Top
Properties
  NameDescription
Public propertyActivityName
Gets name of the current activity.
Public propertyStatic memberNullScope
Gets null activity scope that does nothing (it does not use Correlation Manager at all).
Top
Methods
  NameDescription
Public methodDispose
Dispose method implementation. Stops current logical operation, transfer to the previous activity and sets previous activity id.
Protected methodDispose(Boolean)
Correct implementation of Dispose pattern.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
TraceSource trace = ...
using (var scope = new ActivityScope(trace, "Some Interesting Activity"))
{
   // ...
   using (var scope = new ActivityScope(trace, "Nested Activity"))   
   {
      // ...
   }
   // ...
}
See Also