Debugger2.CurrentProcess Özellik
Alır veya ayarlar etkin işlem.
Ad alanı: EnvDTE80
Derleme: EnvDTE80 (EnvDTE80.dll içinde)
Sözdizimi
'Bildirim
Property CurrentProcess As Process
Get
Set
Process CurrentProcess { get; set; }
property Process^ CurrentProcess {
Process^ get ();
void set (Process^ value);
}
abstract CurrentProcess : Process with get, set
function get CurrentProcess () : Process
function set CurrentProcess (value : Process)
Özellik Değeri
Tür: EnvDTE.Process
Process nesnesi
Yüklenen
Açıklamalar
Etkin işlem hata ayıklayıcı tarafından görüntülenen verileri tanımlayan işlemidir. Aynı anda birden fazla işlem hata ayıklama hata ayıklayıcı desteklemesine rağmen belirli bir anda yalnızca bir işlem etkin olabilir. Daha fazla bilgi için bkz. Birden çok İşlemler hata ayıklama.
Örnekler
Aşağıdaki örnek, nasıl kullanılacağını gösterir CurrentProcess özelliği.
Bu özellik test etmek için:
Hedef uygulama açın. Eklentiyi çalıştırın.
Hiçbir işlem ayıklanacak.
Bir kesme noktası hedef uygulamada ayarlayın. Uygulama hata ayıklama modunda çalıştırın.
Program bir kesme noktasında durur, eklentiyi çalıştırın.
İşlem ayıklanacak.
public static void CurrentProcess(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 Process
Test");
owp.Activate();
owp.OutputString("Current Process Info: ");
EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)dte.Debugger;
EnvDTE80.Process2 process = (EnvDTE80.Process2)debugger.CurrentProcess;
if (process == null)
owp.OutputString("No process is being debugged");
else
owp.OutputString("Process ID = " + process.ProcessID +
" Process Name = " + process.Name);
}
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
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. kısmen güvenilir kod tarafından Kitaplıklar kullanma.