Debugger3.CurrentThread Свойство
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Возвращает или задает отлаживаемый текущий поток.
public:
property EnvDTE::Thread ^ CurrentThread { EnvDTE::Thread ^ get(); void set(EnvDTE::Thread ^ value); };
public:
property EnvDTE::Thread ^ CurrentThread { EnvDTE::Thread ^ get(); void set(EnvDTE::Thread ^ value); };
[System.Runtime.InteropServices.DispId(105)]
public EnvDTE.Thread CurrentThread { [System.Runtime.InteropServices.DispId(105)] get; [System.Runtime.InteropServices.DispId(105)] set; }
[<System.Runtime.InteropServices.DispId(105)>]
[<get: System.Runtime.InteropServices.DispId(105)>]
[<set: System.Runtime.InteropServices.DispId(105)>]
member this.CurrentThread : EnvDTE.Thread with get, set
Public Property CurrentThread As Thread
Значение свойства
Объект Thread.
Реализации
- Атрибуты
Примеры
В следующем примере показано, как использовать свойство CurrentThread.
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