Share via


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 questa chiamata di funzione attende fino a inserire modalità di interruzione o la modalità progettazione prima di restituire.Impostare su false se si desidera che questa chiamata per restituire immediatamente dopo il determinare il debugger per avviare l'esecuzione.Da restituire il debugger potrebbe essere in progettazione, nell'interruzione, o in modalità di esecuzione.
    Visualizzare una panoramica dell'esecuzione di istruzioni di codice per ulteriori informazioni.

Note

RunToCursor esegue il programma nella posizione corrente del cursore del file di origine.vedere Procedura: esecuzione fino a una posizione specificata per ulteriori informazioni.

Esempi

Nell'esempio seguente viene illustrato come utilizzare RunToCursor metodo.

Per testare questo 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