Поделиться через


Process.Terminate Method

Terminates this process.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

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

Parameters

  • WaitForBreakOrEnd
    Type: System.Boolean
    Set to true if the debugging session should stop only when it reaches a break or the end. Set to false if you intend to stop debugging, but you have to perform other tasks in the macro before the debugger breaks or ends. For more information, see Breaking Execution.

Examples

The following example demonstrates how to use the Terminate method.

To test this method

  1. Run the target application in the debug mode. Make sure that the application contains an infinite loop.

  2. Set the breakpoint inside the infinite loop.

  3. Run the add-in.

public static void Terminate(DTE dte)
{
    EnvDTE.Processes processes = dte.Debugger.DebuggedProcesses;
    processes.Item(1).Terminate(true);
}
Shared Sub TerminateMethod(ByRef dte As EnvDTE.DTE)
    Dim processes As EnvDTE.Processes = dte.Debugger.DebuggedProcesses
    processes.Item(1).Terminate(True)
End Sub

.NET Framework Security

See Also

Reference

Process Interface

EnvDTE Namespace