Metodo Debugger2.RunToCursor (Boolean)

Esegue il programma nella posizione corrente del cursore del file di origine.

Spazio dei nomi:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Sintassi

'Dichiarazione
Sub RunToCursor ( _
    WaitForBreakOrEnd As Boolean _
)
void RunToCursor(
    bool WaitForBreakOrEnd
)
void RunToCursor(
    [InAttribute] bool WaitForBreakOrEnd
)
abstract RunToCursor : 
        WaitForBreakOrEnd:bool -> unit 
function RunToCursor(
    WaitForBreakOrEnd : boolean
)

Parametri

  • WaitForBreakOrEnd
    Tipo: System.Boolean
    Impostare su true se la chiamata di funzione deve attendere l'attivazione della modalità di interruzione o di progettazione prima di restituire un risultato.Impostare su false se si desidera che la chiamata restituisca immediatamente un risultato dopo aver indotto il debugger ad avviare l'esecuzione.Al termine, il debugger può essere in modalità di progettazione, interruzione o esecuzione.
    Per ulteriori informazioni, vedere Cenni preliminari sull'esecuzione di codice.

Implementa

Debugger.RunToCursor(Boolean)

Note

Il metodo RunToCursor esegue il programma nella posizione corrente del cursore del file di origine. Per ulteriori informazioni, vedere How to: Run to a Specified Location.

Esempi

Nell'esempio riportato di seguito viene illustrato come utilizzare il metodo RunToCursor.

Per verificare il metodo:

  1. Aprire il progetto di destinazione ed eseguire il componente aggiuntivo.
public static void RunToCursor(EnvDTE80.DTE2 dte)
{
    EnvDTE.TextSelection ts = 
    (EnvDTE.TextSelection)dte.ActiveDocument.Selection;
    ts.GotoLine(15, false);
    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)dte.Debugger;

    debugger.RunToCursor(true);

    // 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("RunToCursor Method 
    Test");
    owp.Activate();
    if (debugger.CurrentProgram.IsBeingDebugged)
        owp.OutputString("This program is being debugged and " +
                         "the cursor is on line: " + ts.CurrentLine);
    else
        owp.OutputString("This program is not being debugged.");
}
Sub RunToLine(Optional ByVal line As Integer = -1)
    If line <> -1 Then
        Dim ts As TextSelection
        ts = DTE2.ActiveDocument.Selection
        ts.GotoLine(line)
        DTE2.Debugger.RunToCursor()
    End If
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Debugger2 Interfaccia

Overload RunToCursor

Spazio dei nomi EnvDTE80