Compartilhar via


IVsParentProject Interface

Allows nested projects to be opened and closed in the proper sequence with the build of the solution hierarchy by the environment.

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

Syntax

'Declaration
<InterfaceTypeAttribute()> _
<GuidAttribute("79001CD1-69C6-45B8-8F7A-DCCCE0469E8D")> _
Public Interface IVsParentProject
[InterfaceTypeAttribute()]
[GuidAttribute("79001CD1-69C6-45B8-8F7A-DCCCE0469E8D")]
public interface IVsParentProject
[InterfaceTypeAttribute()]
[GuidAttribute(L"79001CD1-69C6-45B8-8F7A-DCCCE0469E8D")]
public interface class IVsParentProject
[<InterfaceTypeAttribute()>]
[<GuidAttribute("79001CD1-69C6-45B8-8F7A-DCCCE0469E8D")>]
type IVsParentProject =  interface end
public interface IVsParentProject

The IVsParentProject type exposes the following members.

Methods

  Name Description
Public method CloseChildren Implemented to close nested projects under a parent project.
Public method OpenChildren Implemented to open nested projects under a parent project.

Top

Remarks

IVsParentProject contains two methods, OpenChildren and CloseChildren. The purpose of this interface is to allow nested projects to be opened and closed in the proper sequence with the build of the solution hierarchy by the environment. Information relating to nested projects is contained in the project file for each parent project.

The implementation of the methods should fire the corresponding IVsSolutionEvents3 events - OnBeforeOpeningChildren and OnAfterOpeningChildren in the OpenChildren method and OnBeforeClosingChildren and OnAfterClosingChildren in CloseChildren method.

The solution open order is the following.

For each top level project in the solution:

  • The environment creates the project by calling the project's CreateProject

  • The environment adds the project to Solution Explorer.

  • The environment checks to see if the project is a parent project by querying the project hierarchy for IVsParentProject.

  • If the project supports IVsParentProject, the environment calls the project's OpenChildren method. During this method the project fires OnBeforeOpeningChildren, and for each child (nested) project:

The solution close order is:

  • For each top-level project in the solution the environment calls the project's QueryClose method. In this method, the project calls QueryClose on all of its children.

  • For each top level project in the solution, the environment fires OnBeforeCloseProject for the project.

  • For each top level project in the solution, the environment checks to see if the project is a parent project by querying the project hierarchy for IVsParentProject

  • For each top-level project in the solution, if the project supports IVsParentProject, the environment calls CloseChildren. During this method the project fires OnBeforeClosingChildren, and for each child (nested) project:

    • The parent project calls RemoveVirtualProject.

    • The method fires OnBeforeCloseProject for the child project

    • The environment checks to see if the child project is also a parent project by querying the child project's hierarchy for IVsParentProject

  • If the child project is also a parent project:

Notes to Implementers

Implemented by Parent Projects (projects nesting other projects) to control opening and closing of nested (child) projects.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace