CorrelationManager.StartLogicalOperation Método

Definição

Inicia uma operação lógica em um thread.Starts a logical operation on a thread.

Sobrecargas

StartLogicalOperation()

Inicia uma operação lógica em um thread.Starts a logical operation on a thread.

StartLogicalOperation(Object)

Inicia uma operação lógica com a identidade especificada em um thread.Starts a logical operation with the specified identity on a thread.

StartLogicalOperation()

Inicia uma operação lógica em um thread.Starts a logical operation on a thread.

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

Comentários

A operação lógica é iniciada usando um GUID gerado automaticamente para um identificador de operação lógica.The logical operation is started using an automatically generated GUID for a logical operation identifier.

Aplica-se a

StartLogicalOperation(Object)

Inicia uma operação lógica com a identidade especificada em um thread.Starts a logical operation with the specified identity on a thread.

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

Parâmetros

operationId
Object

Um objeto que identifica a operação.An object identifying the operation.

Exceções

O parâmetro operationId é null.The operationId parameter is null.

Exemplos

O exemplo de código a seguir demonstra o uso do StartLogicalOperation(Object) método inicializando uma operação lógica a ser associada ao thread principal.The following code example demonstrates the use of the StartLogicalOperation(Object) method by initializing a logical operation to be associated with the main thread. Para obter o exemplo de código completo, consulte a CorrelationManager classe.For the complete code example, see the CorrelationManager class.

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")

Comentários

O operationId parâmetro pode ser qualquer objeto, como um String que permita que a operação seja identificada para fins de rastreamento.The operationId parameter can be any object, such as a String that allows the operation to be identified for tracing purposes. O objeto representado por operationId é adicionado à LogicalOperationStack propriedade.The object represented by operationId is added to the LogicalOperationStack property.

Aplica-se a