Partilhar via


IVsParentProject Interface

Definition

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

public interface class IVsParentProject
public interface class IVsParentProject
__interface IVsParentProject
[System.Runtime.InteropServices.Guid("79001CD1-69C6-45B8-8F7A-DCCCE0469E8D")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsParentProject
[System.Runtime.InteropServices.Guid("79001CD1-69C6-45B8-8F7A-DCCCE0469E8D")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsParentProject
[<System.Runtime.InteropServices.Guid("79001CD1-69C6-45B8-8F7A-DCCCE0469E8D")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsParentProject = interface
[<System.Runtime.InteropServices.Guid("79001CD1-69C6-45B8-8F7A-DCCCE0469E8D")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsParentProject = interface
Public Interface IVsParentProject
Attributes

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.

Methods

CloseChildren()

Implemented to close nested projects under a parent project.

OpenChildren()

Implemented to open nested projects under a parent project.

Applies to