Share via


Metodo Debugger.RunToCursor

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

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.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.
    Vedere l'esecuzione di istruzioni 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(DTE dte)
{
    EnvDTE.TextSelection ts = (EnvDTE.TextSelection)dte.ActiveDocument.Selection;
    ts.GotoLine(15, false);
    dte.Debugger.RunToCursor(true);

    // Setup the 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(dte.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.");
}
Shared Sub RunToCursor(ByRef dte As EnvDTE.DTE)
    Dim ts As EnvDTE.TextSelection = dte.ActiveDocument.Selection
    ts.GotoLine(15, False)
    dte.Debugger.RunToCursor(True)
    If dte.Debugger.CurrentProgram.IsBeingDebugged Then
        MessageBox.Show("This program is being debugged and the cursor is on line: " + ts.CurrentLine.ToString(), _
                        "Debugger Test - RunToCursor Test")
    Else
        MessageBox.Show("This program is not being debugged.", _
                        "Debugger Test - RunToCursor Test")
    End If
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Debugger Interfaccia

Spazio dei nomi EnvDTE