Aracılığıyla paylaş


Debugger3.CurrentThread Özellik

Alır veya ayarlar geçerli iş parçacığı ayıklanacak.

Ad alanı:  EnvDTE90
Derleme:  EnvDTE90 (EnvDTE90.dll içinde)

Sözdizimi

'Bildirim
Property CurrentThread As Thread
    Get
    Set
Thread CurrentThread { get; set; }
property Thread^ CurrentThread {
    Thread^ get ();
    void set (Thread^ value);
}
abstract CurrentThread : Thread with get, set
function get CurrentThread () : Thread
function set CurrentThread (value : Thread)

Özellik Değeri

Tür: EnvDTE.Thread
Thread nesnesi

Yüklenen

Debugger2.CurrentThread

Örnekler

Aşağıdaki örnek, nasıl kullanılacağını gösterir CurrentThread özelliği.

Bu özellik test etmek için:

  1. Bir kesme noktası hedef uygulamada ayarlayın. Eklentiyi çalıştırın.

    Geçerli iş parçacığı boştur.

  2. Bir kesme noktası hedef uygulamada ayarlayın. Hedef uygulama hata ayıklama modunda çalıştırın. Program bir kesme noktasında durur, eklentiyi çalıştırın.

public static void CurrentThread(EnvDTE80.DTE2 dte)
{
    // Setup debug Output window.
    Window w = 
    (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Current Thread 
    Test");
    owp.Activate();

    owp.OutputString("Current Thread Info: ");
    EnvDTE90.Debugger3 debugger = (EnvDTE90.Debugger3)dte.Debugger;
    EnvDTE.Thread thread = debugger.CurrentThread;

    if (thread == null)
        owp.OutputString("No program is being debugged");
    else
        foreach (EnvDTE.StackFrame sf in thread.StackFrames)
            owp.OutputString("\nStack Frame: Function " + sf.FunctionName +
                             " returns type " + sf.ReturnType);
}
Sub ShowCurrentProcess()
    ' This function displays the current debugger
    ' mode in the Output window.
    Dim ow As OutputWindow
    ow = DTE2.Windows.Item(Constants.vsWindowKindOutput).Object

    Dim proc As EnvDTE.Process2
    proc = DTE2.Debugger.CurrentProcess

    If (proc Is Nothing) Then
        ow.ActivePane.OutputString("No process is being debugged")
    Else
        ow.ActivePane.OutputString("" + Str(proc.ProcessID) + ": " + _
        poc.Name + vbCrLf)
    End If
End Sub

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

Debugger3 Arabirim

CurrentThread Fazla Yük

EnvDTE90 Ad Alanı