IVsSolutionEvents2 Interface

Listening interface that monitors any notifications of changes to the solution.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
<InterfaceTypeAttribute()> _
<GuidAttribute("A711DF67-B00A-4E82-A990-51B2B450EA0F")> _
Public Interface IVsSolutionEvents2 _
    Inherits IVsSolutionEvents
[InterfaceTypeAttribute()]
[GuidAttribute("A711DF67-B00A-4E82-A990-51B2B450EA0F")]
public interface IVsSolutionEvents2 : IVsSolutionEvents
[InterfaceTypeAttribute()]
[GuidAttribute(L"A711DF67-B00A-4E82-A990-51B2B450EA0F")]
public interface class IVsSolutionEvents2 : IVsSolutionEvents
[<InterfaceTypeAttribute()>]
[<GuidAttribute("A711DF67-B00A-4E82-A990-51B2B450EA0F")>]
type IVsSolutionEvents2 =  
    interface
        interface IVsSolutionEvents
    end
public interface IVsSolutionEvents2 extends IVsSolutionEvents

The IVsSolutionEvents2 type exposes the following members.

Methods

  Name Description
Public method OnAfterCloseSolution Notifies listening clients that a solution has been closed.
Public method OnAfterLoadProject Notifies listening clients that the project has been loaded.
Public method OnAfterMergeSolution Notifies listening clients that all projects have been merged into the open solution.
Public method OnAfterOpenProject Notifies listening clients that the project has been opened.
Public method OnAfterOpenSolution Notifies listening clients that the solution has been opened.
Public method OnBeforeCloseProject Notifies listening clients that the project is about to be closed.
Public method OnBeforeCloseSolution Notifies listening clients that the solution is about to be closed.
Public method OnBeforeUnloadProject Notifies listening clients that the project is about to be unloaded.
Public method OnQueryCloseProject Queries listening clients as to whether the project can be closed.
Public method OnQueryCloseSolution Queries listening clients as to whether the solution can be closed.
Public method OnQueryUnloadProject Queries listening clients as to whether the project can be unloaded.

Top

Remarks

This interface is implemented to track the opening, closing, loading, and unloading of a solution or project of a solution. There are fundamental differences between opening and closing and loading and unloading solutions or projects. For example, when a project is added to the solution, it is both "open" and "loaded" and it is available for all users to access. However, a user can "unload" the project, which then removes it from the solution only for that user. Another user can open the same solution and have that project "loaded." In other words, loading and unloading are user-specific and unloading a project does not remove it from the solution.

If the project cited in this example is "closed" by a user, then that project is effectively removed from the solution altogether, rendering it unavailable to subsequent users of the solution. This same example can be applied at the solution level.

IVsSolutionEvents2 contains methods that are implemented by parent projects containing children (nested) projects. It is implemented in conjunction with IVsParentProject.

You can also query SVsSolution for IVsSolution, Then call AdviseSolutionEvents to get a pointer to IVsSolutionEvents2 if you have a project that needs to listen to solution events.

Notes to Implementers

VSPackages implement this interface to receive notification of events affecting solution status.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace