CorrelationManager.StartLogicalOperation Metoda

Definicja

Uruchamia operację logiczną w wątku.

Przeciążenia

StartLogicalOperation()

Uruchamia operację logiczną w wątku.

StartLogicalOperation(Object)

Uruchamia operację logiczną z określoną tożsamością w wątku.

StartLogicalOperation()

Źródło:
CorrelationManager.cs
Źródło:
CorrelationManager.cs
Źródło:
CorrelationManager.cs

Uruchamia operację logiczną w wątku.

public:
 void StartLogicalOperation();
public void StartLogicalOperation ();
member this.StartLogicalOperation : unit -> unit
Public Sub StartLogicalOperation ()

Uwagi

Operacja logiczna jest uruchamiana przy użyciu automatycznie wygenerowanego identyfikatora GUID dla identyfikatora operacji logicznej.

Dotyczy

StartLogicalOperation(Object)

Źródło:
CorrelationManager.cs
Źródło:
CorrelationManager.cs
Źródło:
CorrelationManager.cs

Uruchamia operację logiczną z określoną tożsamością w wątku.

public:
 void StartLogicalOperation(System::Object ^ operationId);
public void StartLogicalOperation (object operationId);
member this.StartLogicalOperation : obj -> unit
Public Sub StartLogicalOperation (operationId As Object)

Parametry

operationId
Object

Obiekt identyfikujący operację.

Wyjątki

Parametr operationId ma wartość null.

Przykłady

W poniższym przykładzie kodu pokazano użycie StartLogicalOperation(Object) metody przez zainicjowanie operacji logicznej, która ma być skojarzona z głównym wątkiem. Pełny przykład kodu można znaleźć w CorrelationManager klasie .

TraceSource ts = new TraceSource("MyApp");
int i = ts.Listeners.Add(new ConsoleTraceListener());
ts.Listeners[i].TraceOutputOptions = TraceOptions.LogicalOperationStack;
ts.Switch = new SourceSwitch("MyAPP", "Verbose");
// Start the logical operation on the Main thread.
Trace.CorrelationManager.StartLogicalOperation("MainThread");
Dim ts As New TraceSource("MyApp")
Dim i As Integer = ts.Listeners.Add(New ConsoleTraceListener())
ts.Listeners(i).TraceOutputOptions = TraceOptions.LogicalOperationStack
ts.Switch = New SourceSwitch("MyAPP", "Verbose")
' Start the logical operation on the Main thread.
Trace.CorrelationManager.StartLogicalOperation("MainThread")

Uwagi

Parametr operationId może być dowolnym obiektem, takim jak obiekt String , który umożliwia identyfikację operacji na potrzeby śledzenia. Obiekt reprezentowany przez operationId element jest dodawany do LogicalOperationStack właściwości .

Dotyczy