次の方法で共有


CorrelationManager.StartLogicalOperation メソッド

定義

スレッドで論理操作を開始します。

オーバーロード

名前 説明
StartLogicalOperation()

スレッドで論理操作を開始します。

StartLogicalOperation(Object)

スレッドで指定した ID を使用して論理操作を開始します。

StartLogicalOperation()

ソース:
CorrelationManager.cs
ソース:
CorrelationManager.cs
ソース:
CorrelationManager.cs
ソース:
CorrelationManager.cs
ソース:
CorrelationManager.cs

スレッドで論理操作を開始します。

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

注釈

論理操作は、論理操作識別子に対して自動的に生成された GUID を使用して開始されます。

適用対象

StartLogicalOperation(Object)

ソース:
CorrelationManager.cs
ソース:
CorrelationManager.cs
ソース:
CorrelationManager.cs
ソース:
CorrelationManager.cs
ソース:
CorrelationManager.cs

スレッドで指定した ID を使用して論理操作を開始します。

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

パラメーター

operationId
Object

操作を識別するオブジェクト。

例外

operationId パラメーターはnull

次のコード例では、メイン スレッドに関連付ける論理操作を初期化することによって、 StartLogicalOperation(Object) メソッドを使用する方法を示します。 完全なコード例については、 CorrelationManager クラスを参照してください。

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

注釈

operationIdパラメーターには、トレース目的で操作を識別できるStringなど、任意のオブジェクトを指定できます。 operationIdによって表されるオブジェクトが、LogicalOperationStack プロパティに追加されます。

適用対象