SolutionEvents Interface
Provides events for changes to a solution. Use this object for functionality and refer to SolutionEventsClass for this object's documentation.
Assembly: EnvDTE (in EnvDTE.dll)
| Name | Description | |
|---|---|---|
![]() | add_AfterClosing(_dispSolutionEvents_AfterClosingEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | add_BeforeClosing(_dispSolutionEvents_BeforeClosingEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | add_Opened(_dispSolutionEvents_OpenedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | add_ProjectAdded(_dispSolutionEvents_ProjectAddedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | add_ProjectRemoved(_dispSolutionEvents_ProjectRemovedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | add_ProjectRenamed(_dispSolutionEvents_ProjectRenamedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | add_QueryCloseSolution(_dispSolutionEvents_QueryCloseSolutionEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | add_Renamed(_dispSolutionEvents_RenamedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | remove_AfterClosing(_dispSolutionEvents_AfterClosingEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | remove_BeforeClosing(_dispSolutionEvents_BeforeClosingEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | remove_Opened(_dispSolutionEvents_OpenedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | remove_ProjectAdded(_dispSolutionEvents_ProjectAddedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | remove_ProjectRemoved(_dispSolutionEvents_ProjectRemovedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | remove_ProjectRenamed(_dispSolutionEvents_ProjectRenamedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | remove_QueryCloseSolution(_dispSolutionEvents_QueryCloseSolutionEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | remove_Renamed(_dispSolutionEvents_RenamedEventHandler^) | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
| Name | Description | |
|---|---|---|
![]() | AfterClosing | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | BeforeClosing | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | Opened | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | ProjectAdded | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | ProjectRemoved | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | ProjectRenamed | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | QueryCloseSolution | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
![]() | Renamed | This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.(Inherited from _dispSolutionEvents_Event.) |
The SolutionEvents object can go out of scope and be garbage collected before the solution is closed. To retain a reference to this object, declare a private variable in the class in which you implement the solution event handlers.
public class MyClass : IDTExtensibility2
{
private SolutionEvents _solnEvents;
private void MenuItemCallback(object sender, EventArgs e)
{
_solnEvents = dte.Events.SolutionEvents;
_solutionBeforeClosingEventHandler = new _dispSolutionEvents_BeforeClosingEventHandler(this.SolutionBeforeClosing);
_solnEvents.BeforeClosing += _solutionBeforeClosingEventHandler;
}
private _dispSolutionEvents_BeforeClosingEventHandler _solutionBeforeClosingEventHandler
private void SolutionBeforeClosing()
{
System.Windows.Forms.MessageBox.Show("SolutionBeforeClosing");
}
}

