DebuggerEventsClass.OnContextChanged Event

Definition

Fired whenever the current process, program, thread, or stack has been changed through the user interface or through the automation model.

This API supports the product infrastructure and is not intended to be used directly from your code.

public:
 virtual event EnvDTE::_dispDebuggerEvents_OnContextChangedEventHandler ^ OnContextChanged;
public:
 virtual event EnvDTE::_dispDebuggerEvents_OnContextChangedEventHandler ^ OnContextChanged;
public virtual event EnvDTE._dispDebuggerEvents_OnContextChangedEventHandler OnContextChanged;
member this.OnContextChanged : EnvDTE._dispDebuggerEvents_OnContextChangedEventHandler 
Public Overridable Custom Event OnContextChanged As _dispDebuggerEvents_OnContextChangedEventHandler Implements OnContextChanged

Event Type

Implements

Examples

The following example demonstrates how to use the OnContextChanged event.

// Place the following code in the event handler  
EnvDTE.DebuggerEvents debugEvents = applicationObject.Events.DebuggerEvents;  
debugEvents.OnContextChanged +=   
new _dispDebuggerEvents_OnContextChangedEventHandler(DebuggerEvents.ContextHandler);  

// Place the following Event handler code  
public static void StartEvents(DTE dte)  
{  
    System.Windows.Forms.MessageBox.Show("Events are attached.");  
}  

public static void ContextHandler(EnvDTE.Process newProc,   
    EnvDTE.Program newProg, EnvDTE.Thread newThread, EnvDTE.StackFrame newStkFrame)  
{  
    System.Windows.Forms.MessageBox.Show("Debugger enters context changed mode.");  
}  

Applies to